aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-10-23 02:32:34 +0000
committerChristopher Faylor <me@cgf.cx>2002-10-23 02:32:34 +0000
commit281e3b24234d5e0a0ac6a2d8aaca5bffccbba0e2 (patch)
tree67047b3c727a0e7dbbab0511fde43c72217cd3bc /winsup/cygwin
parent082512aea1f22db6d4a7d5087d83de274c8d640c (diff)
downloadnewlib-281e3b24234d5e0a0ac6a2d8aaca5bffccbba0e2.zip
newlib-281e3b24234d5e0a0ac6a2d8aaca5bffccbba0e2.tar.gz
newlib-281e3b24234d5e0a0ac6a2d8aaca5bffccbba0e2.tar.bz2
* fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Nevermind. Revert
everything to previous state wrt ntsec and exec bits.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc52
2 files changed, 30 insertions, 27 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 8b11eee..c5ab98a 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2002-10-22 Christopher Faylor <cgf@redhat.com>
+ * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Nevermind.
+ Revert everything to previous state wrt ntsec and exec bits.
+
+2002-10-22 Christopher Faylor <cgf@redhat.com>
+
* shared.cc (shared_info::initialize): Use correct value for version
comparison.
* include/cygwin/version.h (CYGWIN_VERSION_MAGIC): Use all of a DWORD
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index bb1f495..33dd625 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -300,36 +300,34 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc,
else
{
buf->st_mode |= S_IFREG;
- }
- if (pc->exec_state () == is_executable)
- buf->st_mode |= STD_XBITS;
- }
-
- if (buf->st_mode & STD_XBITS)
- /* already derived */;
- else if (pc->exec_state () == dont_know_if_executable)
- {
- DWORD cur, done;
- char magic[3];
-
- /* First retrieve current position, set to beginning
- of file if not already there. */
- cur = SetFilePointer (get_handle (), 0, NULL, FILE_CURRENT);
- if (cur != INVALID_SET_FILE_POINTER
- && (!cur || SetFilePointer (get_handle (), 0, NULL, FILE_BEGIN)
- != INVALID_SET_FILE_POINTER))
- {
- /* FIXME should we use /etc/magic ? */
- magic[0] = magic[1] = magic[2] = '\0';
- if (ReadFile (get_handle (), magic, 3, &done, NULL) &&
- has_exec_chars (magic, done))
+ if (pc->exec_state () == dont_know_if_executable)
{
- set_execable_p ();
- pc->set_exec ();
- buf->st_mode |= STD_XBITS;
+ DWORD cur, done;
+ char magic[3];
+
+ /* First retrieve current position, set to beginning
+ of file if not already there. */
+ cur = SetFilePointer (get_handle (), 0, NULL, FILE_CURRENT);
+ if (cur != INVALID_SET_FILE_POINTER
+ && (!cur || SetFilePointer (get_handle (), 0, NULL, FILE_BEGIN)
+ != INVALID_SET_FILE_POINTER))
+ {
+ /* FIXME should we use /etc/magic ? */
+ magic[0] = magic[1] = magic[2] = '\0';
+ if (ReadFile (get_handle (), magic, 3, &done, NULL)
+ && has_exec_chars (magic, done))
+ {
+ set_execable_p ();
+ pc->set_exec ();
+ buf->st_mode |= STD_XBITS;
+ }
+ (void) SetFilePointer (get_handle (), cur, NULL, FILE_BEGIN);
+ }
}
- SetFilePointer (get_handle (), cur, NULL, FILE_BEGIN);
}
+
+ if (pc->exec_state () == is_executable)
+ buf->st_mode |= STD_XBITS;
}
buf->st_uid = uid;