Revert "Use vfork() instead of fork() before exec()"

This reverts commit 074686b520.  Which
turned out to not work so well after all.  For instance, launching TTYs
in a background process completely blocked inetd services from even
starting up listening sockets ... proper fork seems to work fine though.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-02-09 00:45:09 +01:00
1 parent cac612c485
commit 51b27e8372
2 files changed
+5 -5

No files matched your search

+4 -4
View File
@@ -446,7 +446,7 @@ int run(char *cmd)
return 1; return 1;
} }
pid = vfork(); pid = fork();
if (0 == pid) { if (0 == pid) {
int i; int i;
FILE *fp; FILE *fp;
@@ -565,7 +565,7 @@ int run_interactive(char *cmd, char *fmt, ...)
pid_t run_getty(char *cmd, char *args[], int console) pid_t run_getty(char *cmd, char *args[], int console)
{ {
pid_t pid = vfork(); pid_t pid = fork();
if (!pid) { if (!pid) {
int fd; int fd;
@@ -629,7 +629,7 @@ pid_t run_getty(char *cmd, char *args[], int console)
int run_parts(char *dir, char *cmd) int run_parts(char *dir, char *cmd)
{ {
struct dirent **e; struct dirent **e;
volatile int i, num; int i, num;
num = scandir(dir, &e, NULL, alphasort); num = scandir(dir, &e, NULL, alphasort);
if (num < 0) { if (num < 0) {
@@ -669,7 +669,7 @@ int run_parts(char *dir, char *cmd)
} }
args[j++] = NULL; args[j++] = NULL;
pid = vfork(); pid = fork();
if (!pid) { if (!pid) {
_d("Calling %s ...", path); _d("Calling %s ...", path);
sig_unblock(); sig_unblock();
+1 -1
View File
@@ -533,7 +533,7 @@ int svc_start(svc_t *svc)
sigaddset(&nmask, SIGCHLD); sigaddset(&nmask, SIGCHLD);
sigprocmask(SIG_BLOCK, &nmask, &omask); sigprocmask(SIG_BLOCK, &nmask, &omask);
pid = vfork(); pid = fork();
sigprocmask(SIG_SETMASK, &omask, NULL); sigprocmask(SIG_SETMASK, &omask, NULL);
if (pid == 0) { if (pid == 0) {
int i = 0; int i = 0;