From e00700cd80a429eb0abf19154b33e0508590216d Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 25 Nov 2003 02:03:17 +0000 Subject: [PATCH] * dtable.cc (build_fh_name): Set error in dummy fhandler when one is noted during path_conv. * fhandler.h (fhandler_base::set_error): New method. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/dtable.cc | 4 +++- winsup/cygwin/fhandler.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5372e40dd..688045d81 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2003-11-24 Christopher Faylor + + * dtable.cc (build_fh_name): Set error in dummy fhandler when one is + noted during path_conv. + * fhandler.h (fhandler_base::set_error): New method. + 2003-11-24 Christopher Faylor * configure.in: Avoid using cygserver unless hosting on cygwin. diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index b2291c7d5..27c543fa4 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -294,8 +294,10 @@ build_fh_name (const char *name, HANDLE h, unsigned opt, suffix_info *si) path_conv pc (name, opt | PC_NULLEMPTY | PC_FULL | PC_POSIX, si); if (pc.error) { + fhandler_base *fh = cnew (fhandler_nodevice) (); + fh->set_error (pc.error); set_errno (pc.error); - return cnew (fhandler_nodevice) (); + return fh; } if (!pc.exists () && h) diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index d88bb1b94..b0fb90405 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -125,6 +125,7 @@ class fhandler_base public: void set_name (path_conv &pc); int error () const {return pc.error;} + void set_error (int error) {pc.error = error;} bool exists () const {return pc.exists ();} int pc_binmode () const {return pc.binmode ();} device& dev () {return pc.dev;}