aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/inotifyd.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-05-31 12:33:24 -0500
committerRob Landley <rob@landley.net>2014-05-31 12:33:24 -0500
commitd8872c43b48eae5501998a4e5a84337017d8fbe6 (patch)
tree8360d8673d0ed40b02f9d58bdf74b639f6e780f9 /toys/pending/inotifyd.c
parentb0d97a0059555cb0e7e0009b72c038aa67aaa769 (diff)
downloadtoybox-d8872c43b48eae5501998a4e5a84337017d8fbe6.tar.gz
Introduce xfork() and make commands use it, and make some WEXITSTATUS() use WIFEXITED() and WTERMSIG()+127.
Diffstat (limited to 'toys/pending/inotifyd.c')
-rw-r--r--toys/pending/inotifyd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/toys/pending/inotifyd.c b/toys/pending/inotifyd.c
index 98de2546..657fcb5f 100644
--- a/toys/pending/inotifyd.c
+++ b/toys/pending/inotifyd.c
@@ -55,11 +55,10 @@ static void sig_handler(int sig)
static int exec_wait(char **args)
{
int status = 0;
- pid_t pid = fork();
+ pid_t pid = xfork();
if (!pid) xexec(args);
- else if (pid > 0) waitpid(pid, &status, 0);
- else perror_exit("fork");
+ else waitpid(pid, &status, 0);
return WEXITSTATUS(status);
}