OSDN Git Service

* dtable.cc (build_fh_name): Set error in dummy fhandler when one is noted
authorcgf <cgf>
Tue, 25 Nov 2003 02:03:17 +0000 (02:03 +0000)
committercgf <cgf>
Tue, 25 Nov 2003 02:03:17 +0000 (02:03 +0000)
during path_conv.
* fhandler.h (fhandler_base::set_error): New method.

winsup/cygwin/dtable.cc
winsup/cygwin/fhandler.h

index b2291c7..27c543f 100644 (file)
@@ -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)
index d88bb1b..b0fb904 100644 (file)
@@ -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;}