diff options
Diffstat (limited to 'lib/spawn-pipe.c')
-rw-r--r-- | lib/spawn-pipe.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/spawn-pipe.c b/lib/spawn-pipe.c index 96d01aa..35567d4 100644 --- a/lib/spawn-pipe.c +++ b/lib/spawn-pipe.c @@ -1,5 +1,5 @@ /* Creation of subprocesses, communicating via pipes. - Copyright (C) 2001-2004, 2006-2011 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006-2013 Free Software Foundation, Inc. Written by Bruno Haible <haible@clisp.cons.org>, 2001. This program is free software: you can redistribute it and/or modify @@ -37,7 +37,7 @@ #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -/* Native Woe32 API. */ +/* Native Windows API. */ # include <process.h> # include "w32spawn.h" @@ -60,7 +60,7 @@ These functions can return -1/EINTR even though we don't have any signal handlers set up, namely when we get interrupted via SIGSTOP. */ -static inline int +static int nonintr_close (int fd) { int retval; @@ -73,7 +73,8 @@ nonintr_close (int fd) } #define close nonintr_close -static inline int +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +static int nonintr_open (const char *pathname, int oflag, mode_t mode) { int retval; @@ -84,8 +85,9 @@ nonintr_open (const char *pathname, int oflag, mode_t mode) return retval; } -#undef open /* avoid warning on VMS */ -#define open nonintr_open +# undef open /* avoid warning on VMS */ +# define open nonintr_open +#endif #endif @@ -114,7 +116,7 @@ create_pipe (const char *progname, { #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ - /* Native Woe32 API. + /* Native Windows API. This uses _pipe(), dup2(), and spawnv(). It could also be implemented using the low-level functions CreatePipe(), DuplicateHandle(), CreateProcess() and _open_osfhandle(); see the GNU make and GNU clisp @@ -196,7 +198,7 @@ create_pipe (const char *progname, (const char **) environ); if (child < 0 && errno == ENOEXEC) { - /* prog is not an native executable. Try to execute it as a + /* prog is not a native executable. Try to execute it as a shell script. Note that prepare_spawn() has already prepended a hidden element "sh.exe" to prog_argv. */ --prog_argv; |