From 5401796acfc2b971a2f2c62eb43dab4ba540b0e5 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 14 Feb 2012 15:22:13 +0000 Subject: [PATCH] * fhandler_disk_file.cc (fhandler_cygdrive::fstat): Don't bother to set st_nlink correctly, just set it to 1 to avoid potential network timeouts. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/fhandler_disk_file.cc | 10 +--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 495c15d79..80803f0b7 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2012-02-14 Corinna Vinschen + + * fhandler_disk_file.cc (fhandler_cygdrive::fstat): Don't bother to + set st_nlink correctly, just set it to 1 to avoid potential network + timeouts. + 2012-02-14 Corinna Vinschen * flock.cc (lf_setlock): Don't close waited lock object handle before diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index a418657e7..13b9d6919 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -2393,15 +2393,7 @@ fhandler_cygdrive::fstat (struct __stat64 *buf) fhandler_base::fstat (buf); buf->st_ino = 2; buf->st_mode = S_IFDIR | STD_RBITS | STD_XBITS; - if (!ndrives) - set_drives (); - char flptst[] = "X:"; - int n = ndrives; - for (const char *p = pdrive; p && *p; p = strchr (p, '\0') + 1) - if (is_floppy ((flptst[0] = *p, flptst)) - || GetFileAttributes (p) == INVALID_FILE_ATTRIBUTES) - n--; - buf->st_nlink = n + 2; + buf->st_nlink = 1; return 0; }