]> diplodocus.org Git - nmh/commitdiff
ap.c, dp.c: exit(3) with 0 or 1, not [0, MAX_EXIT].
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 3 Sep 2017 11:23:14 +0000 (12:23 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 3 Sep 2017 11:23:14 +0000 (12:23 +0100)
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.

h/mh.h
uip/ap.c
uip/dp.c

diff --git a/h/mh.h b/h/mh.h
index e1c5827d88e07552ca964452442311f3102990c0..6d6bc40cbea9d95e274a2556b89983e2237c80c6 100644 (file)
--- a/h/mh.h
+++ b/h/mh.h
 #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.
index a20747f9014121f52c191fa38bccc8114c08cb0d..d08a635d38ef464ba63a6becd99519e45ccdad5e 100644 (file)
--- 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;
 }
 
index 617da203f3e8819c91ac118736fc0d56643905c8..3575c979d4c092a3d6fe4737652537c221d0469b 100644 (file)
--- 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;
 }