From 85bfa90696d69d07d05dddd83b6f93050f0d2508 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 20 Oct 2014 10:29:30 +0000 Subject: [PATCH] * path.cc (symlink_info::check): Set error from status code if opening the parent directory failed, but keep special case for root dirs. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/path.cc | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index baf5a336b..609495c42 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2014-10-20 Corinna Vinschen + + * path.cc (symlink_info::check): Set error from status code if opening + the parent directory failed, but keep special case for root dirs. + 2014-10-17 Corinna Vinschen * cygheap.cc (cygheap_fixup_in_child): Call set_dll_dir. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index e5ce312ed..2ead43f9a 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2834,7 +2834,13 @@ restart: This case is only recognized by the length of the basename part. If it's 0, the incoming file is the root of a drive. So we at least know it's a directory. */ - fileattr = basename.Length ? 0 : FILE_ATTRIBUTE_DIRECTORY; + if (basename.Length) + fileattr = FILE_ATTRIBUTE_DIRECTORY; + else + { + fileattr = 0; + set_error (geterrno_from_nt_status (status)); + } } else {