Browse files

use vfork over fork

as per vfork(3), since we're only using fork as a prelude to exec, this
is a viable, lighter, alternative.
  • Loading branch information...
1 parent 4ad7984 commit c5508da26b5e837100643e499c3bafb7c00109e0 @falconindy committed Apr 20, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 init.c
View
6 init.c
@@ -40,10 +40,10 @@ static int forkexecwait(char **argv) { /* {{{ */
pid_t pid;
int statloc;
- pid = fork();
+ pid = vfork();
if (pid == -1) {
perror("fork");
- return;
+ return errno;
}
if (pid == 0) {
@@ -331,7 +331,7 @@ static pid_t launch_udev(void) { /* {{{ */
msg("Starting udev...\n");
- pid = fork();
+ pid = vfork();
if (pid == -1) {
perror("fork");
return 1;

0 comments on commit c5508da

Please sign in to comment.