$NetBSD: patch-ac,v 1.2 2000/01/05 12:23:56 agc Exp $ --- src/looper.c.orig Sat May 13 20:32:00 1995 +++ src/looper.c Wed Jan 5 12:17:10 2000 @@ -22,6 +22,9 @@ #include #include "timeit.c" +#include +#include +#include unsigned long iter; char *cmd_argv[28]; @@ -84,14 +87,30 @@ perror("Reason"); exit(2); } - else + else { /* master */ wait(&status); - if (status != 0) - { - printf("Bad wait status: 0x%x\n", status); - exit(2); +#if (defined(NetBSD) && (NetBSD < 199810)) + /* NetBSD 1.3H and lower have a bug in dc */ + if (strcmp(cmd_argv[0],"dc") != 0) { + if (WIFSIGNALED(status)) { + printf("signaled: %d\n",WTERMSIG(status)); + exit(2); + } + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) != 0) { + printf("Exit code: %d\n",WEXITSTATUS(status)); + exit(2); + } + } + } /* NetBSD 1.3H */ +#else + if (status != 0) { + printf("Bad wait status: 0x%x\n", status); + exit(2); } +#endif + } /* else */ iter++; } }