incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <Farid_Zari...@epam.com>
Subject RE: svn commit: r562224 - in /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp runall.cpp target.h util.cpp util.h
Date Fri, 03 Aug 2007 16:52:52 GMT
> -----Original Message-----
> From: Andrew Black [mailto:ablack@roguewave.com] 
> Sent: Friday, August 03, 2007 6:36 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: svn commit: r562224 - in 
> /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp 
> runall.cpp target.h util.cpp util.h
> 
> Something in this patch appears to cause the exec utility to 
> hang on Windows.  I haven't had much time to dig into the 
> cause, but I thought I'd give everyone a heads up.  Farid, if 
> you have a chance, could you look into this?

  The exec process deadlocked in (exec.cpp, line 1055):
-----
warn_last_error ("Opening child input stream");
-----
  after the CreateFile (options->infname) has failed (because
options->infname == "/dev/null").

  The proposed fix below, but deadlocking is the another issue to be
resolved:

Index: util.cpp
===================================================================
--- util.cpp	(revision 562407)
+++ util.cpp	(working copy)
@@ -200,9 +200,15 @@
         free (fname);
     }
 
+#ifndef _WIN32
+#define DEV_NULL "/dev/null"
+#else
+#define DEV_NULL "NUL"
+#endif
+
     /* If we didn't find a source file, use /dev/null */
-    fname = (char*)RW_MALLOC (sizeof "/dev/null");
-    strcpy (fname, "/dev/null");
+    fname = (char*)RW_MALLOC (sizeof DEV_NULL);
+    strcpy (fname, DEV_NULL);
     return fname;
 }
 

Farid.

Mime
View raw message