fork: no need to _exit() on the error case
This commit is contained in:
parent
82bebf8ce7
commit
066a0306a1
3
setsid.c
3
setsid.c
|
@ -26,8 +26,7 @@ main(int argc, char *argv[])
|
|||
if (getpgrp() == getpid()) {
|
||||
switch (fork()) {
|
||||
case -1:
|
||||
weprintf("fork:");
|
||||
_exit(1);
|
||||
eprintf("fork:");
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
|
|
3
tar.c
3
tar.c
|
@ -54,8 +54,7 @@ decomp(FILE *fp)
|
|||
|
||||
switch (fork()) {
|
||||
case -1:
|
||||
weprintf("fork:");
|
||||
_exit(1);
|
||||
eprintf("fork:");
|
||||
case 0:
|
||||
dup2(fileno(fp), 0);
|
||||
dup2(fds[1], 1);
|
||||
|
|
3
time.c
3
time.c
|
@ -41,8 +41,7 @@ main(int argc, char *argv[])
|
|||
|
||||
switch ((pid = fork())) {
|
||||
case -1:
|
||||
weprintf("fork:");
|
||||
_exit(1);
|
||||
eprintf("fork:");
|
||||
case 0:
|
||||
execvp(argv[0], argv);
|
||||
savederrno = errno;
|
||||
|
|
Loading…
Reference in New Issue
Block a user