* fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Correctly set

number of links for directory, if appropriate.
This commit is contained in:
Christopher Faylor 2002-06-10 01:25:47 +00:00
parent 007276b30e
commit c2102631fc
2 changed files with 17 additions and 11 deletions

View File

@ -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> 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
* cygwin.din: Add _pthread_cleanup_push and _pthread_cleanup_pop. * cygwin.din: Add _pthread_cleanup_push and _pthread_cleanup_pop.
@ -25,11 +30,11 @@
2002-04-24 Thomas Pfaff <tpfaff@gmx.net> 2002-04-24 Thomas Pfaff <tpfaff@gmx.net>
* include/pthread.h (__pthread_cleanup_handler): New structure * include/pthread.h (__pthread_cleanup_handler): New structure.
(pthread_cleanup_push): Rewritten . (pthread_cleanup_push): Rewritten.
(pthread_cleanup_pop): Ditto. (pthread_cleanup_pop): Ditto.
(_pthread_cleanup_push): New prototype. (_pthread_cleanup_push): New prototype.
(_pthread_cleanup_pop) Ditto. (_pthread_cleanup_pop): Ditto.
2002-04-24 Thomas Pfaff <tpfaff@gmx.net> 2002-04-24 Thomas Pfaff <tpfaff@gmx.net>
@ -809,7 +814,7 @@
descriptor, except if it already appears in my_grps. descriptor, except if it already appears in my_grps.
Use sec_acl() in place of get_dacl(). Use sec_acl() in place of get_dacl().
(verify_token): Create from code in seteuid(), with tighter checks. (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 (get_group_sidlist): Add argument to indicate if pgrpsid is already
in the groups. in the groups.
* security.h: Define verify_token(). * security.h: Define verify_token().

View File

@ -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 (&ftLastAccessTime, &buf->st_atim);
to_timestruc_t (&ftLastWriteTime, &buf->st_mtim); to_timestruc_t (&ftLastWriteTime, &buf->st_mtim);
to_timestruc_t (&ftCreationTime, &buf->st_ctim); to_timestruc_t (&ftCreationTime, &buf->st_ctim);
buf->st_nlink = nNumberOfLinks; buf->st_dev = pc->volser ();
buf->st_dev = pc->volser (); buf->st_size = ((__off64_t)nFileSizeHigh << 32) + nFileSizeLow;
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". /* 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 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. those subdirectories point to it.
This is too slow on remote drives, so we do without it and This is too slow on remote drives, so we do without it and
set the number of links to 2. */ 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", 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, buf, buf->st_atime, buf->st_size, buf->st_mode,