diff options
author | Christopher Faylor <me@cgf.cx> | 2002-05-18 21:07:18 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-05-18 21:07:18 +0000 |
commit | 9ded8bd8b2c7adb14d608ea55d18fba5af59bbc8 (patch) | |
tree | fc55227c6ed2611f8ad89d4871087b44d589ec15 /winsup/cygwin/fhandler_disk_file.cc | |
parent | cf737d6b3266d939179812dcc474f52b8de9096d (diff) | |
download | cygnal-9ded8bd8b2c7adb14d608ea55d18fba5af59bbc8.tar.gz cygnal-9ded8bd8b2c7adb14d608ea55d18fba5af59bbc8.tar.bz2 cygnal-9ded8bd8b2c7adb14d608ea55d18fba5af59bbc8.zip |
* fhandler_disk_file.cc (fhandler_disk_file::fstat): Make handling of nlink
consistent for remote files.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 38c6bd26f..99f8b7ab0 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -107,8 +107,7 @@ fhandler_disk_file::fstat (struct __stat64 *buf, path_conv *pc) /* Unfortunately the count of 2 confuses `find (1)' command. So let's try it with `1' as link count. */ if (pc->isdir ()) - buf->st_nlink = (pc->isremote () - ? 1 : num_entries (pc->get_win32 ())); + buf->st_nlink = pc->isremote () ? 1 : num_entries (pc->get_win32 ()); close (); } else if (pc->exists ()) @@ -118,8 +117,8 @@ fhandler_disk_file::fstat (struct __stat64 *buf, path_conv *pc) WIN32_FIND_DATA wfd; HANDLE handle; buf->st_nlink = 1; - if (pc->isdir () && pc->isremote ()) - buf->st_nlink = num_entries (pc->get_win32 ()); + if (pc->isdir ()) + buf->st_nlink = pc->isremote () ? 1 : num_entries (pc->get_win32 ()); buf->st_dev = FHDEVN (FH_DISK) << 8; buf->st_ino = hash_path_name (0, pc->get_win32 ()); if (pc->isdir ()) |