OSDN Git Service

pending/useradd: unbreak build
authorIsaac Dunham <ibid.ag@gmail.com>
Tue, 10 Jun 2014 13:29:10 +0000 (08:29 -0500)
committerIsaac Dunham <ibid.ag@gmail.com>
Tue, 10 Jun 2014 13:29:10 +0000 (08:29 -0500)
When useradd started using xfork(), the conditional in else if (pid > 0)
became unnecessary, since else means pid is nonzero and xfork makes it
non-negative. However, the "if" was not deleted.

toys/pending/useradd.c

index 99e2530..0a79064 100644 (file)
@@ -61,7 +61,7 @@ static int exec_wait(char **args)
   pid_t pid = xfork();
 
   if (!pid) xexec(args);
-  else if waitpid(pid, &status, 0);
+  else waitpid(pid, &status, 0);
 
   return WIFEXITED(status) ? WEXITSTATUS(status) : WTERMSIG(status)+127;
 }