8#define WHO "bouncesaying"
10int main(
int argc,
char *
const *argv)
16 logmsg(
WHO,100,USAGE,
"bouncesaying error [ program [ arg ... ] ]");
21 logmsg(
WHO,111,FATAL,
"unable to fork: ");
23 execvp(argv[2],argv + 2);
24 if (errno)
_exit(111);
27 if (wait_pid(&wstat,pid) == -1)
28 logmsg(
WHO,111,FATAL,
"wait failed");
29 if (wait_crashed(wstat))
30 logmsg(
WHO,111,FATAL,
"child crashed");
31 switch (wait_exitcode(wstat)) {
33 case 111: logmsg(
WHO,111,FATAL,
"temporary child error");
38 buffer_puts(buffer_2,
WHO);
39 buffer_puts(buffer_2,
": ");
40 buffer_puts(buffer_2,argv[1]);
41 buffer_puts(buffer_2,
"\n");
42 buffer_flush(buffer_2);