prettyness police
[unix-history] / usr / src / usr.bin / cmp / misc.c
index 8f7745d..3bb2f8a 100644 (file)
@@ -6,12 +6,15 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c     8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)misc.c     8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
+
+#include <err.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdlib.h>
+
 #include "extern.h"
 
 void
 #include "extern.h"
 
 void
@@ -19,8 +22,8 @@ eofmsg(file)
        char *file;
 {
        if (!sflag)
        char *file;
 {
        if (!sflag)
-               (void)fprintf(stderr, "cmp: EOF on %s\n", file);
-       exit(1);
+               warnx("EOF on %s", file);
+       exit(DIFF_EXIT);
 }
 
 void
 }
 
 void
@@ -31,34 +34,5 @@ diffmsg(file1, file2, byte, line)
        if (!sflag)
                (void)printf("%s %s differ: char %qd, line %qd\n",
                    file1, file2, byte, line);
        if (!sflag)
                (void)printf("%s %s differ: char %qd, line %qd\n",
                    file1, file2, byte, line);
-       exit(1);
-}
-
-#if __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-void
-#if __STDC__
-err(const char *fmt, ...)
-#else
-err(fmt, va_alist)
-       char *fmt;
-       va_dcl
-#endif
-{
-       va_list ap;
-#if __STDC__
-       va_start(ap, fmt);
-#else
-       va_start(ap);
-#endif
-       (void)fprintf(stderr, "cmp: ");
-       (void)vfprintf(stderr, fmt, ap);
-       va_end(ap);
-       (void)fprintf(stderr, "\n");
-       exit(2);
-       /* NOTREACHED */
+       exit(DIFF_EXIT);
 }
 }