diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 15:52:39 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 15:52:39 +0200 |
commit | a6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f (patch) | |
tree | b88cc7a8457658d67e0321718556ac807f6bccf3 /src/except.c | |
parent | 00be7622c428f279872f84569f098ce16150f8a8 (diff) |
format files
Diffstat (limited to 'src/except.c')
-rw-r--r-- | src/except.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/except.c b/src/except.c index edee976..2d2df4a 100644 --- a/src/except.c +++ b/src/except.c @@ -1,7 +1,8 @@ #include <unistd.h> -#include "wait.h" -#include "logmsg.h" + #include "exit.h" +#include "logmsg.h" +#include "wait.h" #define WHO "except" @@ -10,25 +11,21 @@ int main(int argc, char **argv) int pid; int wstat; - if (!argv[1]) - logmsg(WHO,100,USAGE,"except program [ arg ... ]"); + if (!argv[1]) logmsg(WHO, 100, USAGE, "except program [ arg ... ]"); pid = fork(); - if (pid == -1) - logmsg(WHO,111,FATAL,"unable to fork: "); + if (pid == -1) logmsg(WHO, 111, FATAL, "unable to fork: "); if (pid == 0) { - execvp(argv[1],argv + 1); + execvp(argv[1], argv + 1); if (errno) _exit(111); _exit(100); } - if (wait_pid(&wstat,pid) == -1) - logmsg(WHO,111,FATAL,"wait failed"); - if (wait_crashed(wstat)) - logmsg(WHO,111,FATAL,"child crashed"); + if (wait_pid(&wstat, pid) == -1) logmsg(WHO, 111, FATAL, "wait failed"); + if (wait_crashed(wstat)) logmsg(WHO, 111, FATAL, "child crashed"); switch (wait_exitcode(wstat)) { - case 0: _exit(100); - case 111: logmsg(WHO,111,FATAL,"temporary child error"); - default: _exit(0); + case 0: _exit(100); + case 111: logmsg(WHO, 111, FATAL, "temporary child error"); + default: _exit(0); } } |