diff options
author | Christopher Faylor <me@cgf.cx> | 2002-06-10 01:25:47 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-06-10 01:25:47 +0000 |
commit | c2102631fc6e7e6315780dc217bfdbecd9608234 (patch) | |
tree | ed208404f4208fd8633cecafd70f1e88460fccf3 | |
parent | 007276b30e0a838084eda5c2ac0ba6b9b3243a15 (diff) | |
download | newlib-c2102631fc6e7e6315780dc217bfdbecd9608234.zip newlib-c2102631fc6e7e6315780dc217bfdbecd9608234.tar.gz newlib-c2102631fc6e7e6315780dc217bfdbecd9608234.tar.bz2 |
* fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Correctly set
number of links for directory, if appropriate.
-rw-r--r-- | winsup/cygwin/ChangeLog | 13 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 15 |
2 files changed, 17 insertions, 11 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 4178393..89ea5b3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2002-06-09 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Correctly + set number of links for directory, if appropriate. + 2002-06-10 Robert Collins <rbtcollins@hotmail.com> * cygwin.din: Add _pthread_cleanup_push and _pthread_cleanup_pop. @@ -25,11 +30,11 @@ 2002-04-24 Thomas Pfaff <tpfaff@gmx.net> - * include/pthread.h (__pthread_cleanup_handler): New structure - (pthread_cleanup_push): Rewritten . + * include/pthread.h (__pthread_cleanup_handler): New structure. + (pthread_cleanup_push): Rewritten. (pthread_cleanup_pop): Ditto. (_pthread_cleanup_push): New prototype. - (_pthread_cleanup_pop) Ditto. + (_pthread_cleanup_pop): Ditto. 2002-04-24 Thomas Pfaff <tpfaff@gmx.net> @@ -809,7 +814,7 @@ descriptor, except if it already appears in my_grps. Use sec_acl() in place of get_dacl(). (verify_token): Create from code in seteuid(), with tighter checks. - (get_dacl) Deleted. + (get_dacl): Deleted. (get_group_sidlist): Add argument to indicate if pgrpsid is already in the groups. * security.h: Define verify_token(). diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 6852d3f..443612f 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -203,9 +203,14 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc, to_timestruc_t (&ftLastAccessTime, &buf->st_atim); to_timestruc_t (&ftLastWriteTime, &buf->st_mtim); to_timestruc_t (&ftCreationTime, &buf->st_ctim); - buf->st_nlink = nNumberOfLinks; - buf->st_dev = pc->volser (); - buf->st_size = ((__off64_t)nFileSizeHigh << 32) + nFileSizeLow; + buf->st_dev = pc->volser (); + buf->st_size = ((__off64_t)nFileSizeHigh << 32) + nFileSizeLow; + /* Unfortunately the count of 2 confuses `find (1)' command. So + let's try it with `1' as link count. */ + if (pc->isdir () && !pc->isremote () && nNumberOfLinks == 1) + buf->st_nlink = num_entries (pc->get_win32 ()); + else + buf->st_nlink = nNumberOfLinks; /* Assume that if a drive has ACL support it MAY have valid "inodes". It definitely does not have valid inodes if it does not have ACL @@ -307,10 +312,6 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc, those subdirectories point to it. This is too slow on remote drives, so we do without it and set the number of links to 2. */ - /* 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) - buf->st_nlink = pc->isremote () ? 1 : num_entries (pc->get_win32 ()); syscall_printf ("0 = fstat (, %p) st_atime=%x st_size=%D, st_mode=%p, st_ino=%d, sizeof=%d", buf, buf->st_atime, buf->st_size, buf->st_mode, |