Use sysexits.h for better exit-codes
[mmh] / sbr / cpydgst.c
index a9e5bc6..090cd71 100644 (file)
@@ -7,6 +7,7 @@
 ** complete copyright information.
 */
 
+#include <sysexits.h>
 #include <unistd.h>
 #include <h/mh.h>
 
@@ -27,7 +28,7 @@
 
 #define output(c)  if (bp >= dp) {flush(); *bp++ = c;} else *bp++ = c
 #define flush()  if ((j = bp - outbuf) && write(out, outbuf, j) != j) \
-               adios(ofile, "error writing"); \
+               adios(EX_IOERR, ofile, "error writing"); \
        else \
                bp = outbuf
 
@@ -62,6 +63,6 @@ cpydgst(int in, int out, char *ifile, char *ofile)
                }
 
        if (i == -1)
-               adios(ifile, "error reading");
+               adios(EX_IOERR, ifile, "error reading");
        flush();
 }