diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-03-05 18:31:09 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-03-05 18:31:09 +0000 |
commit | 8a889eff57a95b48187e0e7876f2b7898b3e3df7 (patch) | |
tree | 9bcf3b3bc3d6c7b70131bf5e15c12005dd5b5ae6 /winsup/cygwin/fhandler.cc | |
parent | e3bf57046bfeaf2ce8966aa7b011994e85ee7142 (diff) | |
download | cygnal-8a889eff57a95b48187e0e7876f2b7898b3e3df7.tar.gz cygnal-8a889eff57a95b48187e0e7876f2b7898b3e3df7.tar.bz2 cygnal-8a889eff57a95b48187e0e7876f2b7898b3e3df7.zip |
* child_info.h (~child_info_spawn): Check moreinfo->myself_pinfo for
NULL before closing.
* spawn.cc (spawn_guts): Don't close moreinfo->myself_pinfo explicitely
in case of failing CloseProcess.
* fhandler.cc (fhandler_base::open_): Return EISDIR when trying to
create a directory.
* path.cc (path_conv::check): If input path had a trailing dir
separator, tack it on to the native path if directory doesn't exist.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r-- | winsup/cygwin/fhandler.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index f47805bde..25f167247 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -590,7 +590,13 @@ fhandler_base::open (int flags, mode_t mode) create_disposition, create_options, NULL, 0); if (!NT_SUCCESS (status)) { - __seterrno_from_nt_status (status); + /* Trying to open a directory should return EISDIR, not ENOENT. */ + PUNICODE_STRING upath = pc.get_nt_native_path (); + if (status == STATUS_OBJECT_NAME_INVALID + && upath->Buffer[upath->Length / sizeof (WCHAR) - 1] == '\\') + set_errno (EISDIR); + else + __seterrno_from_nt_status (status); if (!nohandle ()) goto done; } |