comparison toys/pending/inotifyd.c @ 1327:85f297591693 draft

Introduce xfork() and make commands use it, and make some WEXITSTATUS() use WIFEXITED() and WTERMSIG()+127.
author Rob Landley <rob@landley.net>
date Sat, 31 May 2014 12:33:24 -0500
parents 2d4675617dff
children 9f2a1afcf005
comparison
equal deleted inserted replaced
1326:78a3eaf5555f 1327:85f297591693
53 } 53 }
54 54
55 static int exec_wait(char **args) 55 static int exec_wait(char **args)
56 { 56 {
57 int status = 0; 57 int status = 0;
58 pid_t pid = fork(); 58 pid_t pid = xfork();
59 59
60 if (!pid) xexec(args); 60 if (!pid) xexec(args);
61 else if (pid > 0) waitpid(pid, &status, 0); 61 else waitpid(pid, &status, 0);
62 else perror_exit("fork");
63 return WEXITSTATUS(status); 62 return WEXITSTATUS(status);
64 } 63 }
65 64
66 void inotifyd_main(void) 65 void inotifyd_main(void)
67 { 66 {