Index: buf.c
===================================================================
RCS file: /cvs/src/usr.bin/make/buf.c,v
retrieving revision 1.27
diff -u -p -r1.27 buf.c
--- buf.c       29 Apr 2015 00:42:12 -0000      1.27
+++ buf.c       19 Sep 2015 18:35:22 -0000
@@ -66,6 +66,7 @@
  *     Functions for automatically expanded buffers.
  */
 
+#include <err.h>
 #include <ctype.h>
 #include <limits.h>
 #include <stddef.h>
@@ -89,13 +90,6 @@
 #define DO_STAT_BUF(a, b)
 #endif
 
-static void
-fatal_overflow()
-{
-       fprintf(stderr, "buffer size overflow\n");
-       exit(2);
-}
-
 /* BufExpand(bp, nb)
  *     Expand buffer bp to hold upto nb additional
  *     chars.  Makes sure there's room for an extra '\0' char at
@@ -110,7 +104,7 @@ do {                                                        
\
                if (size <= SIZE_MAX/2) {               \
                        size *= 2 ;                     \
                } else {                                \
-                       fatal_overflow();               \
+                       errx(2, "buffer size overflow");                \
                }                                       \
        } while (size - occupied < (nb)+1+BUF_MARGIN);  \
        (bp)->buffer = (bp)->inPtr = (bp)->endPtr =     \
Index: job.c
===================================================================
RCS file: /cvs/src/usr.bin/make/job.c,v
retrieving revision 1.136
diff -u -p -r1.136 job.c
--- job.c       28 Jul 2015 14:22:26 -0000      1.136
+++ job.c       19 Sep 2015 18:35:22 -0000
@@ -93,6 +93,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <ctype.h>
+#include <err.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
@@ -974,8 +975,7 @@ handle_fatal_signal(int signo)
        kill(getpid(), signo);
        sigprocmask(SIG_SETMASK, &emptyset, NULL);
        /*NOTREACHED*/
-       fprintf(stderr, "This should never happen\n");
-       exit(1);
+       errx(1, "This should never happen");
 }
 
 /*

Reply via email to