summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-06-26 21:03:08 +0000
committerChristopher Faylor <me@cgf.cx>2001-06-26 21:03:08 +0000
commit07c3cd5bb1d74bd173c1b98501e3e77ff0ba862a (patch)
tree7b20c1eb9ef656c4678c3de46ff84114ddcff46e /winsup/cygwin/fhandler.cc
parent32c30349694070062428a8b52f362db45bf9d0c1 (diff)
downloadcygnal-07c3cd5bb1d74bd173c1b98501e3e77ff0ba862a.tar.gz
cygnal-07c3cd5bb1d74bd173c1b98501e3e77ff0ba862a.tar.bz2
cygnal-07c3cd5bb1d74bd173c1b98501e3e77ff0ba862a.zip
* fhandler.cc (fhandler_disk_file::fstat): Don't rely on exactly 3 characters
being read for executable test since we could be checking for less than that. * syscalls.cc (stat_worker): Try opening the file the "correct" way first so that #! processing can potentially happen. If that fails, then use "query open" method. * spawn.cc (spawn_guts): Delay processing of signal until after we've notified parent about reparenting.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 6c745c097..65ef21411 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -993,8 +993,8 @@ fhandler_disk_file::fstat (struct stat *buf)
{
/* FIXME should we use /etc/magic ? */
magic[0] = magic[1] = magic[2] = '\0';
- if (ReadFile (get_handle (), magic, 3, &done, 0) &&
- done == 3 && has_exec_chars (magic, done))
+ if (ReadFile (get_handle (), magic, 3, &done, NULL) &&
+ has_exec_chars (magic, done))
set_execable_p ();
SetFilePointer (get_handle(), cur, NULL, FILE_BEGIN);
}