From: Ralph Corderoy Date: Sun, 3 Sep 2017 11:23:14 +0000 (+0100) Subject: ap.c, dp.c: exit(3) with 0 or 1, not [0, MAX_EXIT]. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/94eba9d3c32077aa8548f2132cc43d6a0679272a?ds=sidebyside;hp=afeebe19b502e0956b2d129f431576648786b089 ap.c, dp.c: exit(3) with 0 or 1, not [0, MAX_EXIT]. Don't attempt to indicate the number of failures through the exit status as that's too constrained. Just stick to zero for none, and 1 for some. Delete, the now unused, MAX_EXIT. --- diff --git a/h/mh.h b/h/mh.h index e1c5827d..6d6bc40c 100644 --- a/h/mh.h +++ b/h/mh.h @@ -16,13 +16,6 @@ #define DMAXFOLDER 4 /* typical number of digits */ #define MAXFOLDER 1000 /* message increment */ -/* non-zero exit(3) values indicating the number of errors need to be - * capped else they interfere with the shell's use of high seven-bit - * values, and the shell's mapping of signals onto top-bit-set values. - * Plus, every so often the eight-bit value will wrap to zero, wrongly - * indicating success. */ -#define MAX_EXIT 120 - /* * This macro is for use by scan, for example, so that platforms with * a small BUFSIZ can easily allocate larger buffers. diff --git a/uip/ap.c b/uip/ap.c index a20747f9..d08a635d 100644 --- a/uip/ap.c +++ b/uip/ap.c @@ -128,7 +128,7 @@ main (int argc, char **argv) status += process (addrs[addrp], width); fmt_free (fmt, 1); - done(min(status, MAX_EXIT)); + done(!!status); return 1; } diff --git a/uip/dp.c b/uip/dp.c index 617da203..3575c979 100644 --- a/uip/dp.c +++ b/uip/dp.c @@ -124,7 +124,7 @@ main (int argc, char **argv) context_save (); /* save the context file */ fmt_free (fmt, 1); - done(min(status, MAX_EXIT)); + done(!!status); return 1; }