diff --git a/include/os.h b/include/os.h index 29c849b11..fef7a1719 100644 --- a/include/os.h +++ b/include/os.h @@ -332,8 +332,6 @@ OsAbort(void) _X_NORETURN; #if !defined(WIN32) -extern _X_EXPORT int -System(const char *); extern _X_EXPORT void * Popen(const char *, const char *); extern _X_EXPORT int diff --git a/os/utils.c b/os/utils.c index ba8ebf97a..dc3fdef82 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1297,49 +1297,6 @@ OsAbort(void) * as well. As it is now, xkbcomp messages don't end up in the log file. */ -int -System(const char *command) -{ - int pid, p; - void (*csig) (int); - int status; - - if (!command) - return 1; - - csig = OsSignal(SIGCHLD, SIG_DFL); - if (csig == SIG_ERR) { - perror("signal"); - return -1; - } - DebugF("System: `%s'\n", command); - - switch (pid = fork()) { - case -1: /* error */ - p = -1; - break; - case 0: /* child */ - if (setgid(getgid()) == -1) - _exit(127); - if (setuid(getuid()) == -1) - _exit(127); - execl("/bin/sh", "sh", "-c", command, (char *) NULL); - _exit(127); - default: /* parent */ - do { - p = waitpid(pid, &status, 0); - } while (p == -1 && errno == EINTR); - - } - - if (OsSignal(SIGCHLD, csig) == SIG_ERR) { - perror("signal"); - return -1; - } - - return p == -1 ? -1 : status; -} - static struct pid { struct pid *next; FILE *fp;