stdio.h defines BUFSIZ
[unix-history] / usr / src / usr.bin / make / main.c
index d733905..913f6b5 100644 (file)
@@ -17,7 +17,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.22 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.24 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)main.c    5.22 (Berkeley) %G%";
 #include <sys/param.h>
 #include <sys/signal.h>
 #include <sys/stat.h>
 #include <sys/param.h>
 #include <sys/signal.h>
 #include <sys/stat.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <varargs.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <varargs.h>
@@ -113,7 +114,7 @@ MainParseArgs(argc, argv)
        char c;
 
        optind = 1;     /* since we're called more than once */
        char c;
 
        optind = 1;     /* since we're called more than once */
-rearg: while((c = getopt(argc, argv, "D:I:d:ef:ij:knqrst")) != -1) {
+rearg: while((c = getopt(argc, argv, "D:I:d:ef:ij:knqrst")) != EOF) {
                switch(c) {
                case 'D':
                        Var_Set(optarg, "1", VAR_GLOBAL);
                switch(c) {
                case 'D':
                        Var_Set(optarg, "1", VAR_GLOBAL);
@@ -333,8 +334,6 @@ main(argc, argv)
                        }
                }
                if (chdir(path)) {
                        }
                }
                if (chdir(path)) {
-                       extern int errno;
-
                        (void)fprintf(stderr, "make: %s: %s.\n",
                            path, strerror(errno));
                        exit(2);
                        (void)fprintf(stderr, "make: %s: %s.\n",
                            path, strerror(errno));
                        exit(2);
@@ -732,7 +731,6 @@ char *
 emalloc(len)
        u_int len;
 {
 emalloc(len)
        u_int len;
 {
-       extern int errno;
        char *p, *malloc();
 
        if (!(p = malloc(len)))
        char *p, *malloc();
 
        if (!(p = malloc(len)))