From a6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 15:52:39 +0200 Subject: format files --- src/except.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'src/except.c') 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 -#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); } } -- cgit v1.2.3