]> Savannah Git Hosting - gnulib.git/commitdiff
execute, spawn-pipe: Use _spawnvpe, not spawnvpe.
authorBruno Haible <bruno@clisp.org>
Tue, 11 Aug 2020 18:55:52 +0000 (20:55 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 11 Aug 2020 18:55:52 +0000 (20:55 +0200)
* lib/execute.c (execute): Use _spawnvpe, not spawnvpe.
* lib/spawn-pipe.c (create_pipe): Likewise.
* tests/test-nonblocking-pipe-main.c (main): Likewise.
* tests/test-nonblocking-socket-main.c (main): Likewise.
* lib/wait-process.c: Update comment.
* doc/posix-functions/fork.texi: Update.

ChangeLog
doc/posix-functions/fork.texi
lib/execute.c
lib/spawn-pipe.c
lib/wait-process.c
tests/test-nonblocking-pipe-main.c
tests/test-nonblocking-socket-main.c

index 84549c84bdd609e0f52bca9606f1705827afa562..cd1fdc96b8042ac2cc90b6aa1d0b3cef69de765e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2020-08-11  Bruno Haible  <bruno@clisp.org>
+
+       execute, spawn-pipe: Use _spawnvpe, not spawnvpe.
+       * lib/execute.c (execute): Use _spawnvpe, not spawnvpe.
+       * lib/spawn-pipe.c (create_pipe): Likewise.
+       * tests/test-nonblocking-pipe-main.c (main): Likewise.
+       * tests/test-nonblocking-socket-main.c (main): Likewise.
+       * lib/wait-process.c: Update comment.
+       * doc/posix-functions/fork.texi: Update.
+
 2020-08-11  Bruno Haible  <bruno@clisp.org>
 
        asyncsafe-spin: Use GCC built-ins also on clang.
index bfbc6e2bab84cb2a71c0d69fbe78d3fb95e9c275..cae51d1f82ea2fb4b64c6ad292d639797c60a367 100644 (file)
@@ -23,5 +23,5 @@ call.  @code{vfork} is a variant of @code{fork} that has been introduced to
 optimize the @code{fork}/@code{exec} pattern.
 @item
 On Windows platforms (excluding Cygwin), this function is not implemented; use
-@code{spawnvp} instead.
+@code{_spawnvp} instead.
 @end itemize
index 686fb7e5594459530fa754ede91ddc7b2bca621c..15d9ba98d2ee57a50ba7d2b50998e8122ec6fcb4 100644 (file)
@@ -141,25 +141,25 @@ execute (const char *progname,
               && ((null_stdout && nulloutfd == STDOUT_FILENO)
                   || (null_stderr && nulloutfd == STDERR_FILENO)
                   || close (nulloutfd) >= 0))))
-    /* Use spawnvpe and pass the environment explicitly.  This is needed if
+    /* Use _spawnvpe and pass the environment explicitly.  This is needed if
        the program has modified the environment using putenv() or [un]setenv().
        On Windows, programs have two environments, one in the "environment
        block" of the process and managed through SetEnvironmentVariable(), and
        one inside the process, in the location retrieved by the 'environ'
-       macro.  When using spawnvp() without 'e', the child process inherits a
+       macro.  When using _spawnvp() without 'e', the child process inherits a
        copy of the environment block - ignoring the effects of putenv() and
        [un]setenv().  */
     {
-      exitcode = spawnvpe (P_WAIT, prog_path, (const char **) prog_argv,
-                           (const char **) environ);
+      exitcode = _spawnvpe (P_WAIT, prog_path, (const char **) prog_argv,
+                            (const char **) environ);
       if (exitcode < 0 && errno == ENOEXEC)
         {
           /* 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;
-          exitcode = spawnvpe (P_WAIT, prog_argv[0], (const char **) prog_argv,
-                               (const char **) environ);
+          exitcode = _spawnvpe (P_WAIT, prog_argv[0], (const char **) prog_argv,
+                                (const char **) environ);
         }
     }
   if (nulloutfd >= 0)
index b1c0762a7d23482fdfaab5235c689e6a9361095d..947825ac8ebf0a6b71bb8e955c0e5eebf87a7170 100644 (file)
@@ -118,7 +118,7 @@ create_pipe (const char *progname,
 #if (defined _WIN32 && ! defined __CYGWIN__) || defined __KLIBC__
 
   /* Native Windows API.
-     This uses _pipe(), dup2(), and spawnv().  It could also be implemented
+     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
      and cvs source code.  */
@@ -186,25 +186,25 @@ create_pipe (const char *progname,
     /* The child process doesn't inherit ifd[0], ifd[1], ofd[0], ofd[1],
        but it inherits all open()ed or dup2()ed file handles (which is what
        we want in the case of STD*_FILENO).  */
-    /* Use spawnvpe and pass the environment explicitly.  This is needed if
+    /* Use _spawnvpe and pass the environment explicitly.  This is needed if
        the program has modified the environment using putenv() or [un]setenv().
        On Windows, programs have two environments, one in the "environment
        block" of the process and managed through SetEnvironmentVariable(), and
        one inside the process, in the location retrieved by the 'environ'
-       macro.  When using spawnvp() without 'e', the child process inherits a
+       macro.  When using _spawnvp() without 'e', the child process inherits a
        copy of the environment block - ignoring the effects of putenv() and
        [un]setenv().  */
     {
-      child = spawnvpe (P_NOWAIT, prog_path, (const char **) prog_argv,
-                        (const char **) environ);
+      child = _spawnvpe (P_NOWAIT, prog_path, (const char **) prog_argv,
+                         (const char **) environ);
       if (child < 0 && errno == ENOEXEC)
         {
           /* 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;
-          child = spawnvpe (P_NOWAIT, prog_argv[0], (const char **) prog_argv,
-                            (const char **) environ);
+          child = _spawnvpe (P_NOWAIT, prog_argv[0], (const char **) prog_argv,
+                             (const char **) environ);
         }
     }
   if (child == -1)
index 58a1e1121d4e682927bd71207a53471068da62a9..dd9ea1e1c37dbdd2a0becc1f7e4765e730737961 100644 (file)
@@ -44,7 +44,7 @@
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 
-/* The return value of spawnvp() is really a process handle as returned
+/* The return value of _spawnvp() is really a process handle as returned
    by CreateProcess().  Therefore we can kill it using TerminateProcess.  */
 # define kill(pid,sig) TerminateProcess ((HANDLE) (pid), sig)
 
index e72a9aa6c752b76b16cd087465969ca2d65c35f9..0e132f0037a0cdfbb9daa6e85fd9767d49b1c5f3 100644 (file)
@@ -82,8 +82,8 @@ main (int argc, char *argv[])
     child_argv[2] = NULL;
 
 #if defined _WIN32 && ! defined __CYGWIN__
-    child = spawnvpe (P_NOWAIT, child_path, child_argv,
-                      (const char **) environ);
+    child = _spawnvpe (P_NOWAIT, child_path, child_argv,
+                       (const char **) environ);
     ASSERT (child >= 0);
 #else
     {
index c0f885a31d472cff9ac77c4529242af3b5bf9285..500479de7ce0233baa648e8cdd638cec1fa59fc5 100644 (file)
@@ -69,8 +69,8 @@ main (int argc, char *argv[])
     child_argv[3] = NULL;
 
 #if defined _WIN32 && ! defined __CYGWIN__
-    child = spawnvpe (P_NOWAIT, child_path, child_argv,
-                      (const char **) environ);
+    child = _spawnvpe (P_NOWAIT, child_path, child_argv,
+                       (const char **) environ);
     ASSERT (child >= 0);
 #else
     {