Alexandre Julliard : libport: Remove the _spawnvp() implementation.

Alexandre Julliard julliard at winehq.org
Tue Oct 5 15:51:41 CDT 2021


Module: wine
Branch: master
Commit: 8d3bc5c89cffb01b8a78b3d642804081c7028afd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=8d3bc5c89cffb01b8a78b3d642804081c7028afd

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Oct  5 11:54:42 2021 +0200

libport: Remove the _spawnvp() implementation.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure             |  1 -
 configure.ac          |  1 -
 include/config.h.in   |  3 --
 include/wine/port.h   | 12 -------
 libs/port/Makefile.in |  1 -
 libs/port/spawn.c     | 98 ---------------------------------------------------
 6 files changed, 116 deletions(-)

diff --git a/configure b/configure
index 2bcdd7d7f30..db2e07679d4 100755
--- a/configure
+++ b/configure
@@ -17896,7 +17896,6 @@ CFLAGS="$CFLAGS $BUILTINFLAG"
 for ac_func in \
         __res_get_state \
         __res_getservers \
-	_spawnvp \
 	epoll_create \
 	fork \
 	fstatfs \
diff --git a/configure.ac b/configure.ac
index 767ba3ca202..6321206b9db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2127,7 +2127,6 @@ CFLAGS="$CFLAGS $BUILTINFLAG"
 AC_CHECK_FUNCS(\
         __res_get_state \
         __res_getservers \
-	_spawnvp \
 	epoll_create \
 	fork \
 	fstatfs \
diff --git a/include/config.h.in b/include/config.h.in
index a19e3768808..e27b23f658f 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -965,9 +965,6 @@
 /* Define if Xrandr has the XRRGetProviderResources function */
 #undef HAVE_XRRGETPROVIDERRESOURCES
 
-/* Define to 1 if you have the `_spawnvp' function. */
-#undef HAVE__SPAWNVP
-
 /* Define to 1 if you have the `__builtin_popcount' built-in function. */
 #undef HAVE___BUILTIN_POPCOUNT
 
diff --git a/include/wine/port.h b/include/wine/port.h
index ee15981c20f..b7f537bec86 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -92,18 +92,6 @@ typedef int ssize_t;
 #  endif
 #endif
 
-/* Process creation flags */
-#ifndef _P_WAIT
-# define _P_WAIT    0
-# define _P_NOWAIT  1
-# define _P_OVERLAY 2
-# define _P_NOWAITO 3
-# define _P_DETACH  4
-#endif
-#ifndef HAVE__SPAWNVP
-extern int _spawnvp(int mode, const char *cmdname, const char * const argv[]);
-#endif
-
 #endif  /* _WIN32 */
 
 /****************************************************************
diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in
index a1159d67a02..9b36c6c5a3b 100644
--- a/libs/port/Makefile.in
+++ b/libs/port/Makefile.in
@@ -3,5 +3,4 @@ STATICLIB = libwine_port.a
 C_SRCS = \
 	lstat.c \
 	readlink.c \
-	spawn.c \
 	symlink.c
diff --git a/libs/port/spawn.c b/libs/port/spawn.c
deleted file mode 100644
index e19aa615a5d..00000000000
--- a/libs/port/spawn.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * spawnvp function
- *
- * Copyright 2003 Dimitrie O. Paun
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "config.h"
-#include "wine/port.h"
-
-#if !defined(HAVE__SPAWNVP) && (!defined(_WIN32) || defined(__CYGWIN__))
-
-#include <errno.h>
-#include <signal.h>
-#include <stdlib.h>
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-int _spawnvp(int mode, const char *cmdname, const char *const argv[])
-{
-    int pid, status, wret;
-
-    if (mode == _P_OVERLAY)
-    {
-        execvp(cmdname, (char **)argv);
-        /* if we get here it failed */
-#ifdef ENOTSUP
-        if (errno != ENOTSUP)  /* exec fails on MacOS if the process has multiple threads */
-#endif
-            return -1;
-    }
-
-    pid = fork();
-    if (pid == 0)
-    {
-        /* in child */
-        if (mode == _P_DETACH)
-        {
-            pid = fork();
-            if (pid == -1) _exit(1);
-            else if (pid > 0) _exit(0);
-            /* else in grandchild */
-        }
-
-        signal( SIGPIPE, SIG_DFL );
-        execvp(cmdname, (char **)argv);
-        _exit(1);
-    }
-
-    if (pid == -1)
-        return -1;
-
-    if (mode == _P_OVERLAY) exit(0);
-
-    if (mode == _P_WAIT || mode == _P_DETACH)
-    {
-        while (pid != (wret = waitpid(pid, &status, 0)))
-            if (wret == -1 && errno != EINTR) break;
-
-        if (pid == wret && WIFEXITED(status))
-        {
-            if (mode == _P_WAIT)
-                pid = WEXITSTATUS(status);
-            else /* mode == _P_DETACH */
-                if (WEXITSTATUS(status) != 0) /* child couldn't fork grandchild */
-                    pid = -1;
-        }
-        else
-        {
-            if (mode == _P_WAIT)
-                pid = 255; /* abnormal exit with an abort or an interrupt */
-            else /* mode == _P_DETACH */
-                pid = -1;
-        }
-    }
-
-    return pid;
-}
-
-#endif  /* HAVE__SPAWNVP */




More information about the wine-cvs mailing list