This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 2/4] Cygwin: remove path_conv::is_auto_device()
- From: Ken Brown <kbrown at cornell dot edu>
- To: "cygwin-patches at cygwin dot com" <cygwin-patches at cygwin dot com>
- Date: Sun, 21 Jul 2019 01:53:02 +0000
- Subject: [PATCH 2/4] Cygwin: remove path_conv::is_auto_device()
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=cornell.edu;dmarc=pass action=none header.from=cornell.edu;dkim=pass header.d=cornell.edu;arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8p0mQOZ8yTViXRkR6/ItJlWCrjdSRHjSaBB6EVDIZc8=; b=ZCg03Na9m1cDJ6XhEHPIhQy6LddNrKmFLla2bzz+aTgolu8eYByrMLwDkqrMN/3ep9bKkzgzOQLIBmnmIKrZljEE8u1SJfPiyhoeaCaySPIUf0d88Qa/bz1fr6jdQ6yML6cQo+UCEV+ZpaK5sIdQmuUzWBcJ2F2NfFDL/qsk33vm2KOe0v+C2bmbacmWnn2+e/1ZtPDoHQ7G0/QEMNgCR8rCJM+qAonsUBVIcpqNApnyvts5+F5fRTcaGfnBTDFnb7ibe3yQxcF1YKoakQeCkrfD8T+GDn0dAM0VnmtX1oQnXgxV1ASEiwblql7EvP1UCOT1JimWrY0auu1hhbJY2g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cXrpHJmKAKRvh5El4bByBnLXSR/rtqr8x3lBwzTXRKjV8XARNs0YQSwp1WXiioa9uRJ1UK97sa6HI+th2j8yvtm2iLcW0OGYLe+mmSPFdRnKNWsmEc5JkP92qBaoBVq1G3Wt/7Jp1LgwPGMwQH0rj77g3iGxT8J4M2eLRonp6BYnIeAiGmc6hH/jj8vf0Uo4ZvtTK6wIiil62/cOPLefG9BCuRqJe3Hc+UlYZl88KV0vC23RZIzVjeiPcwtEXmtVWIYmthcBbzaT1yc41BgkQ4DRGZ4i79LTNWirOhObCNTj9RM3dVQAOULTTQOr0fFNpROTPIznYSu1XBBOvhdSLg==
- References: <20190721015238.2127-1-kbrown@cornell.edu>
It is used only once, and the name is supposed to suggest "device that
is not based on the filesystem". This intended meaning is clearer if
we just replace is_auto_device() by its definition at the place where
it's used.
---
winsup/cygwin/path.cc | 2 +-
winsup/cygwin/path.h | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 158f1e5fb..ed58e966f 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1921,7 +1921,7 @@ symlink_worker (const char *oldpath, const char *newpath, bool isdevice)
win32_newpath.get_nt_native_path (), wsym_type);
if ((!isdevice && win32_newpath.exists ())
- || win32_newpath.is_auto_device ())
+ || (win32_newpath.isdevice () && !win32_newpath.is_fs_special ()))
{
set_errno (EEXIST);
__leave;
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index 0c94c6152..d1be1dba0 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -183,7 +183,6 @@ class path_conv
int isfifo () const {return dev.is_device (FH_FIFO);}
int isspecial () const {return dev.not_device (FH_FS);}
int iscygdrive () const {return dev.is_device (FH_CYGDRIVE);}
- int is_auto_device () const {return isdevice () && !is_fs_special ();}
int is_fs_device () const {return isdevice () && is_fs_special ();}
int is_fs_special () const {return dev.is_fs_special ();}
int is_lnk_special () const {return is_fs_device () || isfifo () || is_lnk_symlink ();}
--
2.21.0