]> sourceware.org Git - newlib-cygwin.git/commitdiff
* dtable.cc (build_fh_name): Return pointer to a 'nodevice' rather than a NULL
authorChristopher Faylor <me@cgf.cx>
Fri, 26 Sep 2003 03:26:44 +0000 (03:26 +0000)
committerChristopher Faylor <me@cgf.cx>
Fri, 26 Sep 2003 03:26:44 +0000 (03:26 +0000)
pointer or suffer SEGVs with invalid paths.

winsup/cygwin/ChangeLog
winsup/cygwin/dtable.cc

index f28edfa0e4a843bac4d809c1d0acb72180b9a005..0a2fff3985e022c27da198bc4094423d89d86087 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-25  Christopher Faylor  <cgf@redhat.com>
+
+       * dtable.cc (build_fh_name): Return pointer to a 'nodevice' rather than
+       a NULL pointer or suffer SEGVs with invalid paths.
+
 2003-09-25  Christopher Faylor  <cgf@redhat.com>
 
        * fork.cc (fork_parent): Detect failed pinfo constructor.
index 9ca5d6a8679c120379024fc99969fcb5fabdf3f3..e7b1851046c383c8c5491cab6f37575f325a3f23 100644 (file)
@@ -287,6 +287,7 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle)
     }
 }
 
+#define cnew(name) new ((void *) ccalloc (HEAP_FHANDLER, 1, sizeof (name))) name
 fhandler_base *
 build_fh_name (const char *name, HANDLE h, unsigned opt, suffix_info *si)
 {
@@ -294,7 +295,7 @@ build_fh_name (const char *name, HANDLE h, unsigned opt, suffix_info *si)
   if (pc.error)
     {
       set_errno (pc.error);
-      return NULL;
+      return cnew (fhandler_nodevice) ();
     }
 
   if (!pc.exists () && h)
@@ -325,7 +326,6 @@ build_fh_dev (const device& dev, const char *unix_name)
   return build_fh_pc (pc);
 }
 
-#define cnew(name) new ((void *) ccalloc (HEAP_FHANDLER, 1, sizeof (name))) name
 fhandler_base *
 build_fh_pc (path_conv& pc)
 {
This page took 0.036364 seconds and 5 git commands to generate.