From 8e513b0217c044ed42c61f250bf3065004dc137b Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 9 Mar 2014 18:39:14 +0000 Subject: [PATCH] * dir.cc (opendir): Propagate any errno from build_fh_name. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/dir.cc | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 74b65588d..8fe91e1fd 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2014-03-09 Christopher Faylor + + * dir.cc (opendir): Propagate any errno from build_fh_name. + 2014-03-07 Corinna Vinschen * pwdgrp.h (pwdgrp::is_passwd): New inline method. diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index c1f8a897b..01b9ab882 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -58,6 +58,11 @@ opendir (const char *name) fh = build_fh_name (name, PC_SYM_FOLLOW); if (!fh) res = NULL; + else if (fh->error ()) + { + set_errno (fh->error ()); + res = NULL; + } else if (fh->exists ()) res = fh->opendir (-1); else