Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-02-19 15:37:37 +0300
committerCorinna Vinschen <corinna@vinschen.de>2010-02-19 15:37:37 +0300
commiteb67604071632869f20038ee56df0980ca575843 (patch)
tree99112cacacdbdb0dae21986ff1ce258b6203fcea /winsup/cygwin
parent7ab414f5a0f46acfaeb621de86f6db0ca648321f (diff)
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Set st_rdev
to same value as st_dev. Avoid useless debug output in executable check. Add filename to debug output. (fhandler_disk_file::facl): Simplify code calling fstat methods to just call fstat to avoid errors with the cygdrive directory.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc28
2 files changed, 21 insertions, 15 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 7f999e318..70e5d6a2b 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2010-02-19 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_disk_file.cc (fhandler_base::fstat_helper): Set st_rdev
+ to same value as st_dev. Avoid useless debug output in executable
+ check. Add filename to debug output.
+ (fhandler_disk_file::facl): Simplify code calling fstat methods to
+ just call fstat to avoid errors with the cygdrive directory.
+
2010-02-18 Corinna Vinschen <corinna@vinschen.de>
* nlsfuncs.cc (eval_datetimefmt): Rename force to flags.
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index b6c67b955..2d0dad211 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -547,7 +547,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
to_timestruc_t ((PFILETIME) LastWriteTime, &buf->st_mtim);
to_timestruc_t ((PFILETIME) ChangeTime, &buf->st_ctim);
to_timestruc_t ((PFILETIME) CreationTime, &buf->st_birthtim);
- buf->st_dev = dwVolumeSerialNumber;
+ buf->st_rdev = buf->st_dev = dwVolumeSerialNumber;
buf->st_size = (_off64_t) nFileSize;
/* The number of links to a directory includes the
number of subdirectories in the directory, since all
@@ -685,11 +685,14 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
status = NtReadFile (h, NULL, NULL, NULL, &io, magic,
3, &off, NULL);
- if (NT_SUCCESS (status)
- && has_exec_chars (magic, io.Information))
+ if (NT_SUCCESS (status))
{
- pc.set_exec ();
- buf->st_mode |= STD_XBITS;
+ if (has_exec_chars (magic, io.Information))
+ {
+ /* Heureka, it's an executable */
+ pc.set_exec ();
+ buf->st_mode |= STD_XBITS;
+ }
}
else
debug_printf ("%p = NtReadFile(%S)", status,
@@ -715,9 +718,10 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
}
done:
- 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->st_ino, sizeof (*buf));
+ syscall_printf ("0 = fstat (%S, %p) st_atime=%x st_size=%D, st_mode=%p, "
+ "st_ino=%D, sizeof=%d",
+ pc.get_nt_native_path (), buf, buf->st_atime, buf->st_size,
+ buf->st_mode, buf->st_ino, sizeof (*buf));
return 0;
}
@@ -1017,13 +1021,7 @@ cant_access_acl:
set_errno (ENOSPC);
else
{
- if (!get_handle ())
- {
- query_open (query_read_attributes);
- oret = open (O_BINARY, 0);
- }
- if ((oret && !fstat_by_handle (&st))
- || !fstat_by_name (&st))
+ if (!fstat (&st))
{
aclbufp[0].a_type = USER_OBJ;
aclbufp[0].a_id = st.st_uid;