Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2002 15:15:13 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Dag-Erling Smorgrav <des@ofug.org>
Cc:        cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/bin/chmod chmod.c
Message-ID:  <200207102215.g6AMFDJ9075934@apollo.backplane.com>
References:  <200207102036.g6AKaQej039281@freefall.freebsd.org> <xzpn0szmfrx.fsf@flood.ping.uio.no> <200207102133.g6ALXqu2016453@apollo.backplane.com> <xzpelebmfg1.fsf@flood.ping.uio.no> <200207102141.g6ALfF8w029851@apollo.backplane.com> <xzpadozmex6.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help

:...
:include/unistd.h
:libexec/rshd/rshd.c
:sys/netncp/ncp_lib.h
:sys/sys/cdefs.h
:usr.sbin/lpr/lpd/recvjob.c
:usr.sbin/sysinstall/sysinstall.h
:
:and like I said, we can work around this with WFORMAT=0 for now.
:There is no need to change any code unless we decide to abandon
:__printf0like.
:
:DES
:-- 
:Dag-Erling Smorgrav - des@ofug.org

    It's only problem is with NULLs, at least in regards to the
    buildworld.  We could

    (1) abandon __printf0like for err(), warn(), and errx().

	or

    (2) hack GCC to make it allow NULLs for __printf0like.

	or

    (3) apply the patch below.


    Personally I would much prefer applying the patch and being done 
    with it.  It only applies to warn(), err() and errx() use, it
    seems silly to hack GCC just for those functions.  

    As a second alternative I would not be adverse to pulling __printf0like
    for the above three functions.

    WFORMAT=0 is a fine workaround, except that all -current developers have
    to specify it manually (in other words, it's a cop-out and does not solve
    the problem).  -current development needs to start paying more attention
    to world breakage.  How long has the world been broken this time? 
    I finally got fed up and fixed it today, at least in my tree.

    If someone has a better solution that they can produce a patch set for,
    TODAY, then propose it now or otherwise don't complain when I commit mine.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>

Index: sbin/camcontrol/modeedit.c
===================================================================
RCS file: /home/ncvs/src/sbin/camcontrol/modeedit.c,v
retrieving revision 1.11
diff -u -r1.11 modeedit.c
--- sbin/camcontrol/modeedit.c	30 May 2002 21:38:58 -0000	1.11
+++ sbin/camcontrol/modeedit.c	10 Jul 2002 22:05:56 -0000
@@ -154,7 +154,7 @@
 	/* Allocate memory for the new entry and a copy of the entry name. */
 	if ((newentry = malloc(sizeof(struct editentry))) == NULL ||
 	    (newentry->name = strdup(name)) == NULL)
-		err(EX_OSERR, NULL);
+		err(EX_OSERR, "strdup");
 
 	/* Trim any trailing whitespace for the entry name. */
 	RTRIM(newentry->name);
@@ -287,7 +287,7 @@
 	case 'c':		/* Character array. */
 	case 'z':		/* Null-padded string. */
 		if ((cval = malloc(dest->size + 1)) == NULL)
-			err(EX_OSERR, NULL);
+			err(EX_OSERR, "malloc");
 		bzero(cval, dest->size + 1);
 		strncpy(cval, newvalue, dest->size);
 		if (dest->type == 'z') {
@@ -334,7 +334,7 @@
 	/* Allocate memory for the new entry and a copy of the entry name. */
 	if ((newentry = malloc(sizeof(struct pagename))) == NULL ||
 	    (newentry->name = strdup(name)) == NULL)
-		err(EX_OSERR, NULL);
+		err(EX_OSERR, "strdup");
 
 	/* Trim any trailing whitespace for the page name. */
 	RTRIM(newentry->name);
@@ -656,7 +656,7 @@
 
 	    	/* Allocate a buffer to hold the line + terminating null. */
 	    	if ((buffer = malloc(length + 1)) == NULL)
-			err(EX_OSERR, NULL);
+			err(EX_OSERR, "malloc");
 		memcpy(buffer, line, length);
 		buffer[length] = '\0';
 
@@ -761,7 +761,7 @@
 	 */
 	commandline = malloc(strlen(editor) + strlen(edit_path) + 2);
 	if (commandline == NULL)
-		err(EX_OSERR, NULL);
+		err(EX_OSERR, "malloc");
 	sprintf(commandline, "%s %s", editor, edit_path);
 
 	/* Invoke the editor on the temp file. */
Index: sbin/disklabel/disklabel.c
===================================================================
RCS file: /home/ncvs/src/sbin/disklabel/disklabel.c,v
retrieving revision 1.56
diff -u -r1.56 disklabel.c
--- sbin/disklabel/disklabel.c	3 Jul 2002 16:43:11 -0000	1.56
+++ sbin/disklabel/disklabel.c	10 Jul 2002 22:05:56 -0000
@@ -515,7 +515,7 @@
 		break;
 
 	default:
-		warn((char *)NULL);
+		warn(s);
 		break;
 	}
 }
Index: sbin/dump/main.c
===================================================================
RCS file: /home/ncvs/src/sbin/dump/main.c,v
retrieving revision 1.38
diff -u -r1.38 main.c
--- sbin/dump/main.c	8 Jul 2002 00:29:23 -0000	1.38
+++ sbin/dump/main.c	10 Jul 2002 22:05:56 -0000
@@ -625,7 +625,7 @@
 	/* Allocate space for new arguments. */
 	if ((*argvp = nargv = malloc((argc + 1) * sizeof(char *))) == NULL ||
 	    (p = flagsp = malloc(strlen(ap) + 2)) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 
 	*nargv++ = *argv;
 	argv += 2;
@@ -645,7 +645,7 @@
 				usage();
 			}
 			if ((nargv[0] = malloc(strlen(*argv) + 2 + 1)) == NULL)
-				err(1, NULL);
+				err(1, "malloc");
 			nargv[0][0] = '-';
 			nargv[0][1] = *ap;
 			(void)strcpy(&nargv[0][2], *argv);
Index: sbin/mount/getmntopts.c
===================================================================
RCS file: /home/ncvs/src/sbin/mount/getmntopts.c,v
retrieving revision 1.9
diff -u -r1.9 getmntopts.c
--- sbin/mount/getmntopts.c	9 Oct 1999 11:54:06 -0000	1.9
+++ sbin/mount/getmntopts.c	10 Jul 2002 22:05:56 -0000
@@ -67,7 +67,7 @@
 
 	/* Copy option string, since it is about to be torn asunder... */
 	if ((optbuf = strdup(options)) == NULL)
-		err(1, NULL);
+		err(1, "strdup");
 
 	for (opt = optbuf; (opt = strtok(opt, ",")) != NULL; opt = NULL) {
 		/* Check for "no" prefix. */
Index: sbin/mount_nullfs/mount_nullfs.c
===================================================================
RCS file: /home/ncvs/src/sbin/mount_nullfs/mount_nullfs.c,v
retrieving revision 1.18
diff -u -r1.18 mount_nullfs.c
--- sbin/mount_nullfs/mount_nullfs.c	23 May 2002 23:08:27 -0000	1.18
+++ sbin/mount_nullfs/mount_nullfs.c	10 Jul 2002 22:05:56 -0000
@@ -128,7 +128,7 @@
 	iov[5].iov_len = strlen(target) + 1;
 
 	if (nmount(iov, 6, mntflags))
-		err(1, NULL);
+		err(1, "nmount");
 	exit(0);
 }
 
Index: sbin/mount_portalfs/mount_portalfs.c
===================================================================
RCS file: /home/ncvs/src/sbin/mount_portalfs/mount_portalfs.c,v
retrieving revision 1.19
diff -u -r1.19 mount_portalfs.c
--- sbin/mount_portalfs/mount_portalfs.c	21 Mar 2002 13:14:20 -0000	1.19
+++ sbin/mount_portalfs/mount_portalfs.c	10 Jul 2002 22:05:56 -0000
@@ -164,7 +164,7 @@
 	um = umask(077);
 	(void) unlink(un.sun_path);
 	if (bind(so, (struct sockaddr *) &un, sizeof(un)) < 0)
-		err(1, NULL);
+		err(1, "bind");
 
 	(void) unlink(un.sun_path);
 	(void) umask(um);
@@ -187,7 +187,7 @@
 
 	rc = mount(vfc.vfc_name, mountpt, mntflags, &args);
 	if (rc < 0)
-		err(1, NULL);
+		err(1, "mount");
 
 	/*
 	 * Everything is ready to go - now is a good time to fork
Index: sbin/mount_std/mount_std.c
===================================================================
RCS file: /home/ncvs/src/sbin/mount_std/mount_std.c,v
retrieving revision 1.15
diff -u -r1.15 mount_std.c
--- sbin/mount_std/mount_std.c	5 May 2002 10:08:04 -0000	1.15
+++ sbin/mount_std/mount_std.c	10 Jul 2002 22:05:56 -0000
@@ -160,11 +160,13 @@
 	 * this filesystem has not been converted yet,
 	 * or the user didn't recompile his kernel.
 	 */
-	if (error && (errno == EOPNOTSUPP || errno == ENOSYS || caughtsig))
+	if (error && (errno == EOPNOTSUPP || errno == ENOSYS || caughtsig)) {
 		error = mount(vfc.vfc_name, mntpath, mntflags, NULL);
-
-	if (error)
-		err(EX_OSERR, NULL);
+		if (error)
+			err(EX_OSERR, "mount");
+	} else if (error) {
+		err(EX_OSERR, "nmount");
+	}
 	exit(0);
 }
 
Index: sbin/mount_umapfs/mount_umapfs.c
===================================================================
RCS file: /home/ncvs/src/sbin/mount_umapfs/mount_umapfs.c,v
retrieving revision 1.20
diff -u -r1.20 mount_umapfs.c
--- sbin/mount_umapfs/mount_umapfs.c	21 Mar 2002 13:14:21 -0000	1.20
+++ sbin/mount_umapfs/mount_umapfs.c	10 Jul 2002 22:05:56 -0000
@@ -238,7 +238,7 @@
 		errx(1, "umap filesystem is not available");
 
 	if (mount(vfc.vfc_name, argv[1], mntflags, &args))
-		err(1, NULL);
+		err(1, "mount");
 	exit(0);
 }
 
Index: sbin/newfs_msdos/newfs_msdos.c
===================================================================
RCS file: /home/ncvs/src/sbin/newfs_msdos/newfs_msdos.c,v
retrieving revision 1.16
diff -u -r1.16 newfs_msdos.c
--- sbin/newfs_msdos/newfs_msdos.c	16 May 2002 04:10:36 -0000	1.16
+++ sbin/newfs_msdos/newfs_msdos.c	10 Jul 2002 22:05:56 -0000
@@ -340,7 +340,7 @@
     if (!strchr(fname, '/')) {
 	snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname);
 	if (!(fname = strdup(buf)))
-	    err(1, NULL);
+	    err(1, "strdup");
     }
     dtype = *argv;
     if ((fd = open(fname, opt_N ? O_RDONLY : O_RDWR)) == -1 ||
@@ -432,7 +432,7 @@
 	if (!strchr(bname, '/')) {
 	    snprintf(buf, sizeof(buf), "/boot/%s", bname);
 	    if (!(bname = strdup(buf)))
-		err(1, NULL);
+		err(1, "strdup");
 	}
 	if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb))
 	    err(1, "%s", bname);
@@ -550,7 +550,7 @@
 	now = tv.tv_sec;
 	tm = localtime(&now);
 	if (!(img = malloc(bpb.bps)))
-	    err(1, NULL);
+	    err(1, "malloc");
 	dir = bpb.res + (bpb.spf ? bpb.spf : bpb.bspf) * bpb.nft;
 	for (lsn = 0; lsn < dir + (fat == 32 ? bpb.spc : rds); lsn++) {
 	    x = lsn;
@@ -761,7 +761,7 @@
 	if (i == -1 && slice != -1 && part == -1) {
 	    e = errno;
 	    if (!(s = strdup(fname)))
-		err(1, NULL);
+		err(1, "strdup");
 	    s[s1 - fname] = 0;
 	    if ((fd1 = open(s, O_RDONLY)) != -1) {
 		i = ioctl(fd1, DIOCGDINFO, lp);
Index: sbin/reboot/reboot.c
===================================================================
RCS file: /home/ncvs/src/sbin/reboot/reboot.c,v
retrieving revision 1.16
diff -u -r1.16 reboot.c
--- sbin/reboot/reboot.c	28 May 2002 21:15:49 -0000	1.16
+++ sbin/reboot/reboot.c	10 Jul 2002 22:05:57 -0000
@@ -114,12 +114,12 @@
 		errx(1, "cannot dump (-d) when halting; must reboot instead");
 	if (geteuid()) {
 		errno = EPERM;
-		err(1, NULL);
+		err(1, "geteuid");
 	}
 
 	if (qflag) {
 		reboot(howto);
-		err(1, NULL);
+		err(1, "reboot failed");
 	}
 
 	if (kflag) {
Index: sbin/restore/main.c
===================================================================
RCS file: /home/ncvs/src/sbin/restore/main.c,v
retrieving revision 1.16
diff -u -r1.16 main.c
--- sbin/restore/main.c	21 Jun 2002 06:18:00 -0000	1.16
+++ sbin/restore/main.c	10 Jul 2002 22:05:57 -0000
@@ -320,7 +320,7 @@
 	/* Allocate space for new arguments. */
 	if ((*argvp = nargv = malloc((argc + 1) * sizeof(char *))) == NULL ||
 	    (p = flagsp = malloc(strlen(ap) + 2)) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 
 	*nargv++ = *argv;
 	argv += 2, argc -= 2;
@@ -335,7 +335,7 @@
 				usage();
 			}
 			if ((nargv[0] = malloc(strlen(*argv) + 2 + 1)) == NULL)
-				err(1, NULL);
+				err(1, "malloc");
 			nargv[0][0] = '-';
 			nargv[0][1] = *ap;
 			(void)strcpy(&nargv[0][2], *argv);
Index: usr.bin/apply/apply.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/apply/apply.c,v
retrieving revision 1.21
diff -u -r1.21 apply.c
--- usr.bin/apply/apply.c	10 Dec 2001 21:12:55 -0000	1.21
+++ usr.bin/apply/apply.c	10 Jul 2002 22:06:14 -0000
@@ -134,7 +134,7 @@
 	cmdsize = sizeof(EXEC) - 1 + strlen(argv[0])
 	    + 9 * (sizeof(" %1") - 1) + 1;
 	if ((cmd = malloc(cmdsize)) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 
 	if (n == 0) {
 		/* If nargs not set, default to a single argument. */
@@ -174,7 +174,7 @@
 	 * for the normal case.
 	 */
 	if ((c = malloc(clen = 1024)) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 
 	/*
 	 * (argc) and (argv) are still offset by one to make it simpler to
@@ -189,7 +189,7 @@
 		for (l = strlen(cmd), i = 0; i < nargs; i++)
 			l += strlen(argv[i+1]);
 		if (l > clen && (c = realloc(c, clen = l)) == NULL)
-			err(1, NULL);
+			err(1, "realloc");
 
 		/* Expand command argv references. */
 		for (p = cmd, q = c; *p != '\0'; ++p)
Index: usr.bin/ar/ar.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/ar/ar.c,v
retrieving revision 1.13
diff -u -r1.13 ar.c
--- usr.bin/ar/ar.c	22 Mar 2002 01:19:22 -0000	1.13
+++ usr.bin/ar/ar.c	10 Jul 2002 22:06:14 -0000
@@ -98,7 +98,7 @@
 	*/
 	if (*argv[1] != '-') {
 		if (!(p = malloc((u_int)(strlen(argv[1]) + 2))))
-			err(1, NULL);
+			err(1, "malloc");
 		*p = '-';
 		(void)strcpy(p + 1, argv[1]);
 		argv[1] = p;
Index: usr.bin/calendar/calendar.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/calendar/calendar.c,v
retrieving revision 1.17
diff -u -r1.17 calendar.c
--- usr.bin/calendar/calendar.c	13 Jun 2002 21:20:56 -0000	1.17
+++ usr.bin/calendar/calendar.c	10 Jul 2002 22:06:14 -0000
@@ -81,7 +81,7 @@
 		case 'a':
 			if (getuid()) {
 				errno = EPERM;
-				err(1, NULL);
+				err(1, "rootcheck");
 			}
 			doall = 1;
 			break;
Index: usr.bin/chflags/chflags.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/chflags/chflags.c,v
retrieving revision 1.14
diff -u -r1.14 chflags.c
--- usr.bin/chflags/chflags.c	22 Mar 2002 01:19:26 -0000	1.14
+++ usr.bin/chflags/chflags.c	10 Jul 2002 22:06:14 -0000
@@ -131,7 +131,7 @@
 	}
 
 	if ((ftsp = fts_open(++argv, fts_options , 0)) == NULL)
-		err(1, NULL);
+		err(1, "fts_open");
 
 	for (rval = 0; (p = fts_read(ftsp)) != NULL;) {
 		switch (p->fts_info) {
Index: usr.bin/col/col.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/col/col.c,v
retrieving revision 1.15
diff -u -r1.15 col.c
--- usr.bin/col/col.c	22 Mar 2002 01:19:27 -0000	1.15
+++ usr.bin/col/col.c	10 Jul 2002 22:06:14 -0000
@@ -290,7 +290,7 @@
 			need = l->l_lsize ? l->l_lsize * 2 : 90;
 			if ((l->l_line = realloc(l->l_line,
 			    (unsigned)need * sizeof(CHAR))) == NULL)
-				err(1, (char *)NULL);
+				err(1, "realloc");
 			l->l_lsize = need;
 		}
 		c = &l->l_line[l->l_line_len++];
@@ -408,13 +408,13 @@
 			sorted_size = l->l_lsize;
 			if ((sorted = realloc(sorted,
 			    (unsigned)sizeof(CHAR) * sorted_size)) == NULL)
-				err(1, (char *)NULL);
+				err(1, "realloc");
 		}
 		if (l->l_max_col >= count_size) {
 			count_size = l->l_max_col + 1;
 			if ((count = realloc(count,
 			    (unsigned)sizeof(int) * count_size)) == NULL)
-				err(1, (char *)NULL);
+				err(1, "realloc");
 		}
 		memset(count, 0, sizeof(int) * l->l_max_col + 1);
 		for (i = nchars, c = l->l_line; --i >= 0; c++)
@@ -502,7 +502,7 @@
 
 	if (!line_freelist) {
 		if ((l = realloc(NULL, sizeof(LINE) * NALLOC)) == NULL)
-			err(1, (char *)NULL);
+			err(1, "realloc");
 		line_freelist = l;
 		for (i = 1; i < NALLOC; i++, l++)
 			l->l_next = l + 1;
Index: usr.bin/column/column.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/column/column.c,v
retrieving revision 1.10
diff -u -r1.10 column.c
--- usr.bin/column/column.c	22 Mar 2002 01:19:27 -0000	1.10
+++ usr.bin/column/column.c	10 Jul 2002 22:06:14 -0000
@@ -219,11 +219,11 @@
 	char **cols;
 
 	if ((t = tbl = calloc(entries, sizeof(TBL))) == NULL)
-		err(1, (char *)NULL);
+		err(1, "calloc");
 	if ((cols = calloc((maxcols = DEFCOLS), sizeof(char *))) == NULL)
-		err(1, (char *)NULL);
+		err(1, "calloc");
 	if ((lens = calloc(maxcols, sizeof(int))) == NULL)
-		err(1, (char *)NULL);
+		err(1, "calloc");
 	for (cnt = 0, lp = list; cnt < entries; ++cnt, ++lp, ++t) {
 		for (coloff = 0, p = *lp; (cols[coloff] = strtok(p, separator));
 		    p = NULL)
@@ -232,15 +232,15 @@
 				    DEFCOLS * sizeof(char *))) ||
 				    !(lens = realloc(lens,
 				    (u_int)maxcols + DEFCOLS * sizeof(int))))
-					err(1, NULL);
+					err(1, "realloc");
 				memset((char *)lens + maxcols * sizeof(int),
 				    0, DEFCOLS * sizeof(int));
 				maxcols += DEFCOLS;
 			}
 		if ((t->list = calloc(coloff, sizeof(char *))) == NULL)
-			err(1, (char *)NULL);
+			err(1, "calloc");
 		if ((t->len = calloc(coloff, sizeof(int))) == NULL)
-			err(1, (char *)NULL);
+			err(1, "calloc");
 		for (t->cols = coloff; --coloff >= 0;) {
 			t->list[coloff] = cols[coloff];
 			t->len[coloff] = strlen(cols[coloff]);
@@ -270,7 +270,7 @@
 	if (!list)
 		if ((list = calloc((maxentry = DEFNUM), sizeof(char *))) ==
 		    NULL)
-			err(1, (char *)NULL);
+			err(1, "calloc");
 	while (fgets(buf, MAXLINELEN, fp)) {
 		for (p = buf; *p && isspace(*p); ++p);
 		if (!*p)
@@ -288,7 +288,7 @@
 			maxentry += DEFNUM;
 			if (!(list = realloc(list,
 			    (u_int)maxentry * sizeof(char *))))
-				err(1, NULL);
+				err(1, "realloc");
 		}
 		list[entries++] = strdup(buf);
 	}
Index: usr.bin/csplit/csplit.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/csplit/csplit.c,v
retrieving revision 1.5
diff -u -r1.5 csplit.c
--- usr.bin/csplit/csplit.c	29 Jun 2002 05:31:26 -0000	1.5
+++ usr.bin/csplit/csplit.c	10 Jul 2002 22:06:14 -0000
@@ -230,7 +230,7 @@
 	if (snprintf(currfile, sizeof(currfile), "%s%0*ld", prefix,
 	    (int)sufflen, nfiles) >= sizeof(currfile)) {
 		errno = ENAMETOOLONG;
-		err(1, NULL);
+		err(1, "snprintf");
 	}
 	if ((fp = fopen(currfile, "w+")) == NULL)
 		err(1, "%s", currfile);
Index: usr.bin/ctags/tree.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/ctags/tree.c,v
retrieving revision 1.10
diff -u -r1.10 tree.c
--- usr.bin/ctags/tree.c	30 May 2002 11:43:20 -0000	1.10
+++ usr.bin/ctags/tree.c	10 Jul 2002 22:06:14 -0000
@@ -85,12 +85,12 @@
 		name = nbuf;
 	}
 	if (!(np->entry = strdup(name)))
-		err(1, NULL);
+		err(1, "strdup");
 	np->file = curfile;
 	np->lno = ln;
 	np->left = np->right = 0;
 	if (!(np->pat = strdup(lbuf)))
-		err(1, NULL);
+		err(1, "strdup");
 	if (!head)
 		head = np;
 	else
Index: usr.bin/find/function.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/find/function.c,v
retrieving revision 1.45
diff -u -r1.45 function.c
--- usr.bin/find/function.c	2 Jun 2002 12:57:41 -0000	1.45
+++ usr.bin/find/function.c	10 Jul 2002 22:06:15 -0000
@@ -90,7 +90,7 @@
 	PLAN *new;
 
 	if ((new = malloc(sizeof(PLAN))) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 	new->execute = option->execute;
 	new->flags = option->flags;
 	new->next = NULL;
@@ -545,7 +545,7 @@
 
 	if (plan->flags & F_EXECPLUS) {
 		if ((plan->e_argv[plan->e_ppos] = strdup(file)) == NULL)
-			err(1, NULL);
+			err(1, "strdup");
 		plan->e_len[plan->e_ppos] = strlen(file);
 		plan->e_psize += plan->e_len[plan->e_ppos];
 		if (++plan->e_ppos < plan->e_pnummax &&
@@ -649,11 +649,11 @@
 		cnt += new->e_pnummax + 1;
 	}
 	if ((new->e_argv = malloc(cnt * sizeof(char *))) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 	if ((new->e_orig = malloc(cnt * sizeof(char *))) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 	if ((new->e_len = malloc(cnt * sizeof(int))) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 
 	for (argv = *argvp, cnt = 0; argv < ap; ++argv, ++cnt) {
 		new->e_orig[cnt] = *argv;
@@ -664,7 +664,7 @@
 			    p[1] == '}') {
 				if ((new->e_argv[cnt] =
 				    malloc(MAXPATHLEN)) == NULL)
-					err(1, NULL);
+					err(1, "malloc");
 				new->e_len[cnt] = MAXPATHLEN;
 				break;
 			}
@@ -1312,7 +1312,7 @@
 	char errbuf[LINE_MAX];
 
 	if ((pre = malloc(sizeof(regex_t))) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 
 	pattern = nextarg(option, argvp);
 
Index: usr.bin/find/misc.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/find/misc.c,v
retrieving revision 1.6
diff -u -r1.6 misc.c
--- usr.bin/find/misc.c	1 Apr 2002 22:56:56 -0000	1.6
+++ usr.bin/find/misc.c	10 Jul 2002 22:06:15 -0000
@@ -72,7 +72,7 @@
 		if (ch == '{' && orig[1] == '}') {
 			while ((p - *store) + plen > len)
 				if (!(*store = realloc(*store, len *= 2)))
-					err(1, NULL);
+					err(1, "realloc");
 			memmove(p, path, plen);
 			p += plen;
 			++orig;
Index: usr.bin/finger/finger.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/finger/finger.c,v
retrieving revision 1.28
diff -u -r1.28 finger.c
--- usr.bin/finger/finger.c	2 Jul 2002 08:00:20 -0000	1.28
+++ usr.bin/finger/finger.c	10 Jul 2002 22:06:15 -0000
@@ -277,7 +277,7 @@
 
 	if ((nargv = malloc((argc+1) * sizeof(char *))) == NULL ||
 	    (used = calloc(argc, sizeof(int))) == NULL)
-		err(1, NULL);
+		err(1, "malloc/calloc");
 
 	/* Pull out all network requests. */
 	for (ap = p = argv, np = nargv; *p; ++p)
@@ -318,7 +318,7 @@
 		for (p = argv; *p; ++p) {
 		    if (strcmp(*p, conf_alias) == NULL) {
 			if ((*p = strdup(conf_realname+1)) == NULL) {
-			    err(1, NULL);
+			    err(1, "strdup");
 			}
 		    }
 		}
Index: usr.bin/finger/util.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/finger/util.c,v
retrieving revision 1.19
diff -u -r1.19 util.c
--- usr.bin/finger/util.c	17 May 2002 05:11:04 -0000	1.19
+++ usr.bin/finger/util.c	10 Jul 2002 22:06:15 -0000
@@ -182,7 +182,7 @@
 
 	if (db == NULL &&
 	    (db = dbopen(NULL, O_RDWR, 0, DB_BTREE, NULL)) == NULL)
-		err(1, NULL);
+		err(1, "dbopen");
 
 	key.data = pw->pw_name;
 	key.size = strlen(pw->pw_name);
@@ -245,7 +245,7 @@
 	PERSON *p;
 
 	if ((p = malloc(sizeof(PERSON))) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 	return(p);
 }
 
@@ -256,7 +256,7 @@
 	WHERE *w;
 
 	if ((w = malloc(sizeof(WHERE))) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 	if (pn->whead == NULL)
 		pn->whead = pn->wtail = w;
 	else {
Index: usr.bin/fstat/fstat.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/fstat/fstat.c,v
retrieving revision 1.43
diff -u -r1.43 fstat.c
--- usr.bin/fstat/fstat.c	30 Jun 2002 05:21:20 -0000	1.43
+++ usr.bin/fstat/fstat.c	10 Jul 2002 22:06:15 -0000
@@ -131,7 +131,7 @@
 		free(ofiles); \
 		ofiles = malloc((d) * sizeof(struct file *)); \
 		if (ofiles == NULL) { \
-			err(1, NULL); \
+			err(1, "malloc"); \
 		} \
 		maxfiles = (d); \
 	}
@@ -711,7 +711,7 @@
 		return (NULL);
 	}
 	if ((mt = malloc(sizeof (struct mtab))) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 	mt->m = m;
 	bcopy(&mount.mnt_stat.f_mntonname[0], &mt->mntonname[0], MNAMELEN);
 	mt->next = mhead;
@@ -925,7 +925,7 @@
 		return(0);
 	}
 	if ((cur = malloc(sizeof(DEVS))) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 	cur->next = devs;
 	devs = cur;
 
Index: usr.bin/fstat/msdosfs.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/fstat/msdosfs.c,v
retrieving revision 1.6
diff -u -r1.6 msdosfs.c
--- usr.bin/fstat/msdosfs.c	30 Jun 2002 05:21:20 -0000	1.6
+++ usr.bin/fstat/msdosfs.c	10 Jul 2002 22:06:15 -0000
@@ -99,7 +99,7 @@
 
 	if (!mnt) {
 		if ((mnt = malloc(sizeof(struct dosmount))) == NULL)
-			err(1, NULL);
+			err(1, "malloc");
 		mnt->next = mounts;
 		mounts = mnt;
 		mnt->kptr = denode.de_pmp;
Index: usr.bin/head/head.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/head/head.c,v
retrieving revision 1.17
diff -u -r1.17 head.c
--- usr.bin/head/head.c	30 Jun 2002 05:21:22 -0000	1.17
+++ usr.bin/head/head.c	10 Jul 2002 22:06:15 -0000
@@ -170,7 +170,7 @@
 		if (ap[0] != '-' || ap[1] == '-' || !isdigit(ap[1]))
 			return;
 		if ((ap = malloc(strlen(*argv) + 2)) == NULL)
-			err(1, NULL);
+			err(1, "malloc");
 		ap[0] = '-';
 		ap[1] = 'n';
 		(void)strcpy(ap + 2, *argv + 1);
Index: usr.bin/hexdump/display.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/hexdump/display.c,v
retrieving revision 1.16
diff -u -r1.16 display.c
--- usr.bin/hexdump/display.c	30 Jun 2002 05:21:22 -0000	1.16
+++ usr.bin/hexdump/display.c	10 Jul 2002 22:06:15 -0000
@@ -244,9 +244,9 @@
 
 	if (!curp) {
 		if ((curp = calloc(1, blocksize)) == NULL)
-			err(1, NULL);
+			err(1, "calloc");
 		if ((savp = calloc(1, blocksize)) == NULL)
-			err(1, NULL);
+			err(1, "calloc");
 	} else {
 		tmpp = curp;
 		curp = savp;
Index: usr.bin/hexdump/odsyntax.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/hexdump/odsyntax.c,v
retrieving revision 1.15
diff -u -r1.15 odsyntax.c
--- usr.bin/hexdump/odsyntax.c	30 Jun 2002 05:21:22 -0000	1.15
+++ usr.bin/hexdump/odsyntax.c	10 Jul 2002 22:06:15 -0000
@@ -362,7 +362,7 @@
 	asprintf(&hdfmt, "%lu/%lu \" %%%d.%de \" \"\\n\"",
 	    16UL / (u_long)isize, (u_long)isize, digits + 8, digits);
 	if (hdfmt == NULL)
-		err(1, NULL);
+		err(1, "asprintf");
 	odadd(hdfmt);
 	free(hdfmt);
 
@@ -427,7 +427,7 @@
 	    16UL / (u_long)isize, (u_long)isize, (int)(4 * isize - digits),
 	    "", (fchar == 'd' || fchar == 'u') ? "" : "0", digits, fchar);
 	if (hdfmt == NULL)
-		err(1, NULL);
+		err(1, "asprintf");
 	odadd(hdfmt);
 	free(hdfmt);
 
Index: usr.bin/hexdump/parse.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/hexdump/parse.c,v
retrieving revision 1.11
diff -u -r1.11 parse.c
--- usr.bin/hexdump/parse.c	30 Jun 2002 05:21:22 -0000	1.11
+++ usr.bin/hexdump/parse.c	10 Jul 2002 22:06:15 -0000
@@ -88,7 +88,7 @@
 
 	/* start new linked list of format units */
 	if ((tfs = calloc(1, sizeof(FS))) == NULL)
-		err(1, NULL);
+		err(1, "calloc");
 	if (!fshead)
 		fshead = tfs;
 	else
@@ -105,7 +105,7 @@
 
 		/* allocate a new format unit and link it in */
 		if ((tfu = calloc(1, sizeof(FU))) == NULL)
-			err(1, NULL);
+			err(1, "calloc");
 		*nextfu = tfu;
 		nextfu = &tfu->nextfu;
 		tfu->reps = 1;
@@ -143,7 +143,7 @@
 			if (*p++ == 0)
 				badfmt(fmt);
 		if (!(tfu->fmt = malloc(p - savep + 1)))
-			err(1, NULL);
+			err(1, "malloc");
 		(void) strncpy(tfu->fmt, savep, p - savep);
 		tfu->fmt[p - savep] = '\0';
 		escape(tfu->fmt);
@@ -225,7 +225,7 @@
 		 */
 		for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) {
 			if ((pr = calloc(1, sizeof(PR))) == NULL)
-				err(1, NULL);
+				err(1, "calloc");
 			if (!fu->nextpr)
 				fu->nextpr = pr;
 			else
@@ -396,7 +396,7 @@
 			savech = *p2;
 			p1[0] = '\0';
 			if ((pr->fmt = calloc(1, strlen(fmtp) + 2)) == NULL)
-				err(1, NULL);
+				err(1, "calloc");
 			(void)strcpy(pr->fmt, fmtp);
 			(void)strcat(pr->fmt, cs);
 			*p2 = savech;
Index: usr.bin/join/join.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/join/join.c,v
retrieving revision 1.16
diff -u -r1.16 join.c
--- usr.bin/join/join.c	30 Jun 2002 05:25:00 -0000	1.16
+++ usr.bin/join/join.c	10 Jul 2002 22:06:16 -0000
@@ -294,7 +294,7 @@
 			F->setalloc += 50;
 			if ((F->set = realloc(F->set,
 			    F->setalloc * sizeof(LINE))) == NULL)
-				err(1, NULL);
+				err(1, "realloc");
 			memset(F->set + cnt, 0, 50 * sizeof(LINE));
 
 			/* re-set lastlp in case it moved */
@@ -325,7 +325,7 @@
 			lp->linealloc += MAX(100, len + 1 - lp->linealloc);
 			if ((lp->line =
 			    realloc(lp->line, lp->linealloc)) == NULL)
-				err(1, NULL);
+				err(1, "realloc");
 		}
 		memmove(lp->line, bp, len);
 
@@ -345,7 +345,7 @@
 				lp->fieldalloc += 50;
 				if ((lp->fields = realloc(lp->fields,
 				    lp->fieldalloc * sizeof(char *))) == NULL)
-					err(1, NULL);
+					err(1, "realloc");
 			}
 			lp->fields[lp->fieldcnt++] = fieldp;
 		}
@@ -513,7 +513,7 @@
 			olistalloc += 50;
 			if ((olist = realloc(olist,
 			    olistalloc * sizeof(OLIST))) == NULL)
-				err(1, NULL);
+				err(1, "realloc");
 		}
 		olist[olistcnt].filenum = filenum;
 		olist[olistcnt].fieldno = fieldno;
@@ -595,7 +595,7 @@
 				if (len - 2 != strspn(*p + 2, "0123456789"))
 					break;
 				if ((t = malloc(len + 3)) == NULL)
-					err(1, NULL);
+					err(1, "malloc");
 				t[0] = '-';
 				t[1] = 'o';
 				memmove(t + 2, *p, len + 1);
Index: usr.bin/logname/logname.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/logname/logname.c,v
retrieving revision 1.6
diff -u -r1.6 logname.c
--- usr.bin/logname/logname.c	30 Jun 2002 05:25:05 -0000	1.6
+++ usr.bin/logname/logname.c	10 Jul 2002 22:06:16 -0000
@@ -62,7 +62,7 @@
 	if (argc != 1)
 		usage();
 	if ((p = getlogin()) == NULL)
-		err(1, NULL);
+		err(1, "getlogin");
 	(void)printf("%s\n", p);
 	exit(0);
 }
Index: usr.bin/m4/eval.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/m4/eval.c,v
retrieving revision 1.19
diff -u -r1.19 eval.c
--- usr.bin/m4/eval.c	3 May 2002 14:48:21 -0000	1.19
+++ usr.bin/m4/eval.c	10 Jul 2002 22:06:16 -0000
@@ -741,7 +741,7 @@
 	if (fopen_trypath(infile+ilevel+1, ifile) != NULL) {
 		ilevel++;
 		if ((inname[ilevel] = strdup(ifile)) == NULL)
-			err(1, NULL);
+			err(1, "strdup");
 		inlineno[ilevel] = 1;
 		bbase[ilevel] = bufbase = bp;
 		emitline();
Index: usr.bin/m4/main.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/m4/main.c,v
retrieving revision 1.19
diff -u -r1.19 main.c
--- usr.bin/m4/main.c	20 Jun 2002 11:14:54 -0000	1.19
+++ usr.bin/m4/main.c	10 Jul 2002 22:06:16 -0000
@@ -248,7 +248,7 @@
 		set_input(infile+0, stdin, "stdin");
 					/* default input (naturally) */
 		if ((inname[0] = strdup("-")) == NULL)
-			err(1, NULL);
+			err(1, "strdup");
 		inlineno[0] = 1;
 		emitline();
 		macro();
@@ -265,7 +265,7 @@
 			sp = -1;
 			fp = 0; 
 			if ((inname[0] = strdup(p)) == NULL)
-				err(1, NULL);
+				err(1, "strdup");
 			inlineno[0] = 1;
 			emitline();
 			macro();
Index: usr.bin/make/main.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/make/main.c,v
retrieving revision 1.66
diff -u -r1.66 main.c
--- usr.bin/make/main.c	13 Jun 2002 08:55:29 -0000	1.66
+++ usr.bin/make/main.c	10 Jul 2002 22:06:16 -0000
@@ -491,7 +491,7 @@
 	 */
 	curdir = cdpath;
 	if (getcwd(curdir, MAXPATHLEN) == NULL)
-		err(2, NULL);
+		err(2, "getcwd");
 
 	if (stat(curdir, &sa) == -1)
 	    err(2, "%s", curdir);
@@ -1268,7 +1268,7 @@
 void
 enomem()
 {
-	err(2, NULL);
+	err(2, "memory");
 }
 
 /*
Index: usr.bin/mkstr/mkstr.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/mkstr/mkstr.c,v
retrieving revision 1.8
diff -u -r1.8 mkstr.c
--- usr.bin/mkstr/mkstr.c	28 Apr 2002 12:28:41 -0000	1.8
+++ usr.bin/mkstr/mkstr.c	10 Jul 2002 22:06:16 -0000
@@ -295,7 +295,7 @@
 	if (!really || hp == 0) {
 		hp = (struct hash *) calloc(1, sizeof *hp);
 		if (hp == NULL)
-			err(1, NULL);
+			err(1, "calloc");
 		hp->hnext = bucket[i];
 		hp->hval = hashval;
 		hp->hpt = really ? ftell(mesgwrite) : fakept;
Index: usr.bin/mt/mt.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/mt/mt.c,v
retrieving revision 1.32
diff -u -r1.32 mt.c
--- usr.bin/mt/mt.c	9 Jul 2002 11:26:09 -0000	1.32
+++ usr.bin/mt/mt.c	10 Jul 2002 22:06:16 -0000
@@ -299,7 +299,7 @@
 			err(1, "%s: %s", tape, comp->c_name);
 	} else {
 		if (ioctl(mtfd, MTIOCGET, &mt_status) < 0)
-			err(1, NULL);
+			err(1, "ioctl");
 		status(&mt_status);
 	}
 	exit(0);
Index: usr.bin/nm/nm.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/nm/nm.c,v
retrieving revision 1.18
diff -u -r1.18 nm.c
--- usr.bin/nm/nm.c	28 Apr 2002 12:04:20 -0000	1.18
+++ usr.bin/nm/nm.c	10 Jul 2002 22:06:17 -0000
@@ -236,7 +236,7 @@
 	int extra = strlen(fn) + 3;
 
 	if ((name = malloc(MAXNAMLEN + extra)) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 	ar_name = name + extra;
 
 	rval = 0;
@@ -384,7 +384,7 @@
 
 	/* get memory for the symbol table */
 	if ((names = malloc((size_t)head.a_syms)) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 	nrawnames = head.a_syms / sizeof(*names);
 	if (fread((char *)names, (size_t)head.a_syms, (size_t)1, fp) != 1) {
 		warnx("%s: cannot read symbol table", objname);
@@ -403,7 +403,7 @@
 		return(1);
 	}
 	if ((stab = malloc((size_t)stabsize)) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 
 	/*
 	 * read the string table offset by 4 - all indices into the string
Index: usr.bin/nohup/nohup.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/nohup/nohup.c,v
retrieving revision 1.8
diff -u -r1.8 nohup.c
--- usr.bin/nohup/nohup.c	28 Jun 2002 09:34:46 -0000	1.8
+++ usr.bin/nohup/nohup.c	10 Jul 2002 22:06:17 -0000
@@ -127,7 +127,7 @@
 
 dupit:
 	if (dup2(fd, STDOUT_FILENO) == -1)
-		err(EXIT_MISC, NULL);
+		err(EXIT_MISC, "dup2");
 	(void)fprintf(stderr, "appending output to %s\n", p);
 }
 
Index: usr.bin/paste/paste.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/paste/paste.c,v
retrieving revision 1.13
diff -u -r1.13 paste.c
--- usr.bin/paste/paste.c	24 May 2002 08:56:49 -0000	1.13
+++ usr.bin/paste/paste.c	10 Jul 2002 22:06:17 -0000
@@ -123,7 +123,7 @@
 
 	for (cnt = 0, head = NULL; (p = *argv); ++argv, ++cnt) {
 		if ((lp = malloc(sizeof(LIST))) == NULL)
-			err(1, NULL);
+			err(1, "malloc");
 		if (p[0] == '-' && !p[1])
 			lp->fp = stdin;
 		else if (!(lp->fp = fopen(p, "r")))
Index: usr.bin/rsh/rsh.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/rsh/rsh.c,v
retrieving revision 1.28
diff -u -r1.28 rsh.c
--- usr.bin/rsh/rsh.c	8 May 2002 00:47:01 -0000	1.28
+++ usr.bin/rsh/rsh.c	10 Jul 2002 22:06:17 -0000
@@ -251,7 +251,7 @@
 		/* fully qualify hostname (needed for krb_realmofhost) */
 		hp = gethostbyname(host);
 		if (hp != NULL && !(host = strdup(hp->h_name)))
-			err(1, NULL);
+			err(1, "strdup");
 
 		rem = KSUCCESS;
 		errno = 0;
@@ -476,7 +476,7 @@
 	for (ap = argv; *ap; ++ap)
 		cc += strlen(*ap) + 1;
 	if (!(args = malloc((u_int)cc)))
-		err(1, NULL);
+		err(1, "malloc");
 	for (p = args, ap = argv; *ap; ++ap) {
 		(void)strcpy(p, *ap);
 		for (p = strcpy(p, *ap); *p; ++p);
Index: usr.bin/ruptime/ruptime.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/ruptime/ruptime.c,v
retrieving revision 1.15
diff -u -r1.15 ruptime.c
--- usr.bin/ruptime/ruptime.c	28 Apr 2002 10:56:09 -0000	1.15
+++ usr.bin/ruptime/ruptime.c	10 Jul 2002 22:06:17 -0000
@@ -140,12 +140,12 @@
 		if (nhosts == hspace) {
 			if ((hs =
 			    realloc(hs, (hspace += 40) * sizeof(*hs))) == NULL)
-				err(1, NULL);
+				err(1, "realloc");
 			hsp = hs + nhosts;
 		}
 
 		if ((hsp->hs_wd = malloc((size_t)WHDRSIZE)) == NULL)
-			err(1, NULL);
+			err(1, "malloc");
 		memmove(hsp->hs_wd, buf, (size_t)WHDRSIZE);
 
 		for (wd = (struct whod *)buf, i = 0; i < 2; ++i)
Index: usr.bin/symorder/symorder.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/symorder/symorder.c,v
retrieving revision 1.17
diff -u -r1.17 symorder.c
--- usr.bin/symorder/symorder.c	22 Mar 2002 01:42:31 -0000	1.17
+++ usr.bin/symorder/symorder.c	10 Jul 2002 22:06:17 -0000
@@ -179,7 +179,7 @@
 	(void)fseek(f, sa, SEEK_SET);
 	n = exec.a_syms;
 	if (!(symtab = (struct nlist *)malloc(n)))
-		err(ERREXIT, NULL);
+		err(ERREXIT, "malloc");
 	if (fread((void *)symtab, 1, n, f) != (u_char)n)
 		badfmt("corrupted symbol table");
 
@@ -189,7 +189,7 @@
 		badfmt("corrupted string table");
 	strings = malloc(strtabsize);
 	if (strings == NULL)
-		err(ERREXIT, NULL);
+		err(ERREXIT, "malloc");
 	/*
 	 * Subtract four from strtabsize since strtabsize includes itself,
 	 * and we've already read it.
@@ -202,7 +202,7 @@
 	if (!clean) {
 		newtab = (struct nlist *)malloc(n);
 		if (newtab == (struct nlist *)NULL)
-			err(ERREXIT, NULL);
+			err(ERREXIT, "malloc");
 		memset(newtab, 0, n);
 
 		reorder(symtab, newtab, i);
@@ -214,7 +214,7 @@
 
 	newstrings = malloc(strtabsize);
 	if (newstrings == NULL)
-		err(ERREXIT, NULL);
+		err(ERREXIT, "malloc");
 	t = newstrings;
 	for (symp = symtab; --i >= 0; symp++) {
 		if (symp->n_un.n_strx == 0)
Index: usr.bin/tsort/tsort.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/tsort/tsort.c,v
retrieving revision 1.14
diff -u -r1.14 tsort.c
--- usr.bin/tsort/tsort.c	17 May 2002 05:11:07 -0000	1.14
+++ usr.bin/tsort/tsort.c	10 Jul 2002 22:06:17 -0000
@@ -195,7 +195,7 @@
 	size_t size;
 {
 	if ((bp = realloc(bp, size)) == NULL)
-		err(1, NULL);
+		err(1, "realloc");
 	return (bp);
 }
 
@@ -265,7 +265,7 @@
 	}
 
 	if ((n = malloc(sizeof(NODE) + key.size)) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 
 	n->n_narcs = 0;
 	n->n_arcsize = 0;
@@ -338,7 +338,7 @@
 			cycle_buf = malloc(sizeof(NODE *) * cnt);
 			longest_cycle = malloc(sizeof(NODE *) * cnt);
 			if (cycle_buf == NULL || longest_cycle == NULL)
-				err(1, NULL);
+				err(1, "malloc");
 		}
 		for (n = graph; n != NULL; n = n->n_next)
 			if (!(n->n_flags & NF_ACYCLIC)) {
Index: usr.bin/uac/uac.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/uac/uac.c,v
retrieving revision 1.2
diff -u -r1.2 uac.c
--- usr.bin/uac/uac.c	2 Jun 2002 20:05:57 -0000	1.2
+++ usr.bin/uac/uac.c	10 Jul 2002 22:06:17 -0000
@@ -95,7 +95,7 @@
 	u_int64_t uac;
 
 	if (alpha_getuac(&uac) != 0)
-		err(1, NULL);
+		err(1, "alpha_getuac");
 
 	while ((c = getopt(argc, argv, "fpsr")) != -1) {
 		switch (c) {
@@ -119,7 +119,7 @@
 
 	if (argc != 1) {	
 		if (alpha_setuac(uac) != 0)
-			err(1, NULL);
+			err(1, "alpha_setuac");
 	}
 
 	print_uac(uac);
Index: usr.bin/w/w.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/w/w.c,v
retrieving revision 1.54
diff -u -r1.54 w.c
--- usr.bin/w/w.c	7 Jun 2002 01:41:54 -0000	1.54
+++ usr.bin/w/w.c	10 Jul 2002 22:06:18 -0000
@@ -330,7 +330,7 @@
 		ep->args = fmt_argv(kvm_getargv(kd, ep->kp, argwidth),
 		    ep->kp->ki_comm, MAXCOMLEN);
 		if (ep->args == NULL)
-			err(1, NULL);
+			err(1, "fmt_argv");
 	}
 	/* sort by idle time */
 	if (sortidle && ehead != NULL) {
Index: usr.bin/whereis/whereis.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/whereis/whereis.c,v
retrieving revision 1.7
diff -u -r1.7 whereis.c
--- usr.bin/whereis/whereis.c	4 Jul 2002 12:29:39 -0000	1.7
+++ usr.bin/whereis/whereis.c	10 Jul 2002 22:06:18 -0000
@@ -91,7 +91,7 @@
 	if (len == 0)
 		err(1, "user_cs_path: sysctl: zero length");
 	if ((std = malloc(len)) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 	if (sysctl(mib, 2, std, &len, NULL, 0) == -1) {
 		sverrno = errno;
 		free(std);
Index: usr.bin/which/which.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/which/which.c,v
retrieving revision 1.5
diff -u -r1.5 which.c
--- usr.bin/which/which.c	30 Jun 2002 06:02:39 -0000	1.5
+++ usr.bin/which/which.c	10 Jul 2002 22:06:18 -0000
@@ -78,7 +78,7 @@
 	pathlen = strlen(p) + 1;
 	path = malloc(pathlen);
 	if (path == NULL)
-		err(EXIT_FAILURE, NULL);
+		err(EXIT_FAILURE, "malloc");
 
 	if (argc == 0)
 		status = EXIT_FAILURE;
Index: usr.bin/write/write.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/write/write.c,v
retrieving revision 1.16
diff -u -r1.16 write.c
--- usr.bin/write/write.c	29 May 2002 13:14:51 -0000	1.16
+++ usr.bin/write/write.c	10 Jul 2002 22:06:18 -0000
@@ -314,7 +314,7 @@
 	unsigned char *s;
 {
 
-#define	PUTC(c)	if (putchar(c) == EOF) err(1, NULL);
+#define	PUTC(c)	if (putchar(c) == EOF) err(1, "putchar");
 
 	for (; *s != '\0'; ++s) {
 		if (*s == '\n') {
Index: usr.bin/xstr/xstr.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/xstr/xstr.c,v
retrieving revision 1.6
diff -u -r1.6 xstr.c
--- usr.bin/xstr/xstr.c	22 Mar 2002 01:42:45 -0000	1.6
+++ usr.bin/xstr/xstr.c	10 Jul 2002 22:06:18 -0000
@@ -358,7 +358,7 @@
 		errx(8, "calloc");
 	hp->hpt = mesgpt;
 	if (!(hp->hstr = strdup(str)))
-		err(1, NULL);
+		err(1, "strdup");
 	mesgpt += strlen(hp->hstr) + 1;
 	hp->hnext = hp0->hnext;
 	hp->hnew = new;
Index: usr.sbin/accton/accton.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/accton/accton.c,v
retrieving revision 1.5
diff -u -r1.5 accton.c
--- usr.sbin/accton/accton.c	28 Aug 1999 01:15:10 -0000	1.5
+++ usr.sbin/accton/accton.c	10 Jul 2002 22:06:18 -0000
@@ -73,7 +73,7 @@
 	switch(argc) {
 	case 0:
 		if (acct(NULL))
-			err(1, NULL);
+			err(1, "acct");
 		break;
 	case 1:
 		if (acct(*argv))
Index: usr.sbin/boot0cfg/boot0cfg.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/boot0cfg/boot0cfg.c,v
retrieving revision 1.12
diff -u -r1.12 boot0cfg.c
--- usr.sbin/boot0cfg/boot0cfg.c	11 Dec 2001 06:44:29 -0000	1.12
+++ usr.sbin/boot0cfg/boot0cfg.c	10 Jul 2002 22:06:18 -0000
@@ -358,7 +358,7 @@
     int inv, i, x;
 
     if (!(s = strdup(arg)))
-        err(1, NULL);
+        err(1, "strdup");
     for (s1 = s; (q = strtok(s1, ",")); s1 = NULL) {
         if ((inv = !strncmp(q, "no", 2)))
             q += 2;
Index: usr.sbin/boot98cfg/boot98cfg.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/boot98cfg/boot98cfg.c,v
retrieving revision 1.2
diff -u -r1.2 boot98cfg.c
--- usr.sbin/boot98cfg/boot98cfg.c	24 Jun 2001 18:51:40 -0000	1.2
+++ usr.sbin/boot98cfg/boot98cfg.c	10 Jul 2002 22:06:18 -0000
@@ -96,7 +96,7 @@
         if (stat(buf, &sb))
             snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname);
         if (!(s = strdup(buf)))
-            err(1, NULL);
+            err(1, "strdup");
     }
     return s;
 }
Index: usr.sbin/btxld/btxld.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/btxld/btxld.c,v
retrieving revision 1.4
diff -u -r1.4 btxld.c
--- usr.sbin/btxld/btxld.c	4 Jan 2000 14:10:36 -0000	1.4
+++ usr.sbin/btxld/btxld.c	10 Jul 2002 22:06:18 -0000
@@ -250,7 +250,7 @@
     if ((fdo = open(name, O_CREAT | O_TRUNC | O_WRONLY, 0666)) == -1)
 	err(2, "%s", name);
     if (!(tname = strdup(name)))
-	err(2, NULL);
+	err(2, "strdup");
     puthdr(fdo, &ohdr);
     for (i = I_LDR; i <= I_CLNT; i++) {
 	fname = i == I_LDR ? lname : i == I_BTX ? bname : iname;
Index: usr.sbin/cdcontrol/cdcontrol.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/cdcontrol/cdcontrol.c,v
retrieving revision 1.39
diff -u -r1.39 cdcontrol.c
--- usr.sbin/cdcontrol/cdcontrol.c	8 May 2002 07:40:22 -0000	1.39
+++ usr.sbin/cdcontrol/cdcontrol.c	10 Jul 2002 22:06:19 -0000
@@ -271,7 +271,7 @@
 		arg = input (&cmd);
 		if (run (cmd, arg) < 0) {
 			if (verbose)
-				warn(NULL);
+				warn("run()");
 			close (fd);
 			fd = -1;
 		}
Index: usr.sbin/chown/chown.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/chown/chown.c,v
retrieving revision 1.23
diff -u -r1.23 chown.c
--- usr.sbin/chown/chown.c	30 Jun 2002 15:30:14 -0000	1.23
+++ usr.sbin/chown/chown.c	10 Jul 2002 22:06:19 -0000
@@ -152,7 +152,7 @@
 		a_gid(*argv);
 
 	if ((ftsp = fts_open(++argv, fts_options, 0)) == NULL)
-		err(1, NULL);
+		err(1, "fts_open");
 
 	for (rval = 0; (p = fts_read(ftsp)) != NULL;) {
 		switch (p->fts_info) {
Index: usr.sbin/daemon/daemon.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/daemon/daemon.c,v
retrieving revision 1.1
diff -u -r1.1 daemon.c
--- usr.sbin/daemon/daemon.c	30 Aug 2001 04:48:02 -0000	1.1
+++ usr.sbin/daemon/daemon.c	10 Jul 2002 22:06:19 -0000
@@ -63,7 +63,7 @@
 	if (argc == 0)
 		usage();
 	if (daemon(nochdir, noclose) == -1)
-		err(1, NULL);
+		err(1, "daemon");
 	execvp(argv[0], argv);
 
 	/* The child is now running, so the exit status doesn't matter. */
Index: usr.sbin/elf2aout/elf2aout.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/elf2aout/elf2aout.c,v
retrieving revision 1.6
diff -u -r1.6 elf2aout.c
--- usr.sbin/elf2aout/elf2aout.c	25 May 2002 13:43:16 -0000	1.6
+++ usr.sbin/elf2aout/elf2aout.c	10 Jul 2002 22:06:19 -0000
@@ -103,10 +103,10 @@
 		usage();
 
 	if ((efd = open(*av, O_RDONLY)) < 0 || fstat(efd, &sb) < 0)
-		err(1, NULL);
+		err(1, "open");
 	v = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, efd, 0);
 	if ((e = v) == MAP_FAILED)
-		err(1, NULL);
+		err(1, "mmap");
 
 	if (!IS_ELF(*e))
 		errx(1, "not an elf file");
@@ -144,7 +144,7 @@
 			a.a_entry = htoxe32(entry);
 			if (write(fd, &a, sizeof(a)) != sizeof(a) ||
 			    write(fd, (char *)e + offset, filesz) != (ssize_t)filesz)
-				err(1, NULL);
+				err(1, "write");
 			break;
 		default:
 			break;
Index: usr.sbin/kgzip/kgzcmp.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/kgzip/kgzcmp.c,v
retrieving revision 1.6
diff -u -r1.6 kgzcmp.c
--- usr.sbin/kgzip/kgzcmp.c	9 Jul 2001 09:23:59 -0000	1.6
+++ usr.sbin/kgzip/kgzcmp.c	10 Jul 2002 22:06:19 -0000
@@ -125,10 +125,10 @@
 	errx(1, "%s: Format not supported", idi->fname);
     xseek(ido, off);
     if (pipe(fd))
-	err(1, NULL);
+	err(1, "pipe");
     switch (pid = fork()) {
     case -1:
-	err(1, NULL);
+	err(1, "fork");
     case 0:
 	close(fd[1]);
 	dup2(fd[0], STDIN_FILENO);
@@ -147,7 +147,7 @@
 	    fmt == F_AOUT ? ld_aout(idi, &idp, kh, &hdr.ex) : -1;
 	close(fd[1]);
 	if ((pid = waitpid(pid, &status, 0)) == -1)
-	    err(1, NULL);
+	    err(1, "waitpid");
 	if (WIFSIGNALED(status) || WEXITSTATUS(status))
 	    exit(1);
     }
Index: usr.sbin/kgzip/kgzip.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/kgzip/kgzip.c,v
retrieving revision 1.6
diff -u -r1.6 kgzip.c
--- usr.sbin/kgzip/kgzip.c	20 Nov 2000 20:35:35 -0000	1.6
+++ usr.sbin/kgzip/kgzip.c	10 Jul 2002 22:06:19 -0000
@@ -150,7 +150,7 @@
     fn[i++] = (char *)f1;
     if (i == FN_OBJ && !cflag) {
 	if ((fd = mkstemp(tname)) == -1)
-	    err(1, NULL);
+	    err(1, "mkstemp");
 	close(fd);
 	fn[i++] = (char *)tname;
     }
@@ -158,7 +158,7 @@
 	p = (p = strrchr(f1, '/')) ? p + 1 : f1;
 	n = (size_t)(s - p);
 	if (!(fn[i] = malloc(n + SFX_MAX)))
-	    err(1, NULL);
+	    err(1, "malloc");
 	memcpy(fn[i], p, n);
 	strcpy(fn[i] + n, i == FN_OBJ ? SFX_OBJ : SFX_KGZ);
     }
Index: usr.sbin/kgzip/kgzld.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/kgzip/kgzld.c,v
retrieving revision 1.4
diff -u -r1.4 kgzld.c
--- usr.sbin/kgzip/kgzld.c	9 Jul 2001 09:23:59 -0000	1.4
+++ usr.sbin/kgzip/kgzld.c	10 Jul 2002 22:06:20 -0000
@@ -81,7 +81,7 @@
     sprintf(addr, "%#x", align(kh->dload + kh->dsize, 0x1000));
     switch (pid = fork()) {
     case -1:
-	err(1, NULL);
+	err(1, "fork");
     case 0:
 	if (format == F_AOUT)
 	    execlp("ld", "ld", "-aout", "-Z", "-T", addr, "-o", f2,
@@ -93,7 +93,7 @@
 	_exit(1);
     default:
 	if ((pid = waitpid(pid, &status, 0)) == -1)
-	    err(1, NULL);
+	    err(1, "waitpid");
 	if (WIFSIGNALED(status) || WEXITSTATUS(status))
 	    exit(1);
     }
Index: usr.sbin/mailwrapper/mailwrapper.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/mailwrapper/mailwrapper.c,v
retrieving revision 1.7
diff -u -r1.7 mailwrapper.c
--- usr.sbin/mailwrapper/mailwrapper.c	9 Aug 2001 06:20:18 -0000	1.7
+++ usr.sbin/mailwrapper/mailwrapper.c	10 Jul 2002 22:06:20 -0000
@@ -64,7 +64,7 @@
 	al->argc = 0;
 	al->maxc = 10;
 	if ((al->argv = malloc(al->maxc * sizeof(char *))) == NULL)
-		err(1, NULL);
+		err(1, "malloc");
 }
 
 static void
@@ -83,14 +83,14 @@
 			if (al->argv)
 				free(al->argv);
 			al->argv = NULL;
-			err(1, NULL);
+			err(1, "realloc");
 		} else {
 			al->argv = argv2;
 		}
 	}
 	if (copy) {
 		if ((al->argv[al->argc++] = strdup(arg)) == NULL)
-			err(1, NULL);
+			err(1, "strdup");
 	} else
 		al->argv[al->argc++] = (char *)arg;
 }
Index: usr.sbin/mtree/misc.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/mtree/misc.c,v
retrieving revision 1.9
diff -u -r1.9 misc.c
--- usr.sbin/mtree/misc.c	17 Jun 2000 14:19:33 -0000	1.9
+++ usr.sbin/mtree/misc.c	10 Jul 2002 22:06:20 -0000
@@ -123,7 +123,7 @@
 		string = strdup("none");
 	}
 	if (string == NULL)
-		err(1, NULL);
+		err(1, "fflagstostr");
 
 	return string;
 }
Index: usr.sbin/pkg_install/info/main.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pkg_install/info/main.c,v
retrieving revision 1.40
diff -u -r1.40 main.c
--- usr.sbin/pkg_install/info/main.c	5 May 2002 13:44:32 -0000	1.40
+++ usr.sbin/pkg_install/info/main.c	10 Jul 2002 22:06:22 -0000
@@ -48,7 +48,7 @@
 
     whead = malloc(sizeof(struct which_head));
     if (whead == NULL)
-	err(2, NULL);
+	err(2, "malloc");
     TAILQ_INIT(whead);
 
     pkgs = start = argv;
@@ -136,7 +136,7 @@
 	case 'O':
 	    LookUpOrigin = strdup(optarg);
 	    if (LookUpOrigin == NULL)
-		err(2, NULL);
+		err(2, "strdup");
 	    break;
 
 	case 'V':
@@ -169,7 +169,7 @@
 
 		entp = calloc(1, sizeof(struct which_entry));
 		if (entp == NULL)
-		    err(2, NULL);
+		    err(2, "calloc");
 		
 		strlcpy(entp->file, optarg, PATH_MAX);
 		entp->skip = FALSE;
Index: usr.sbin/pkg_install/info/perform.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pkg_install/info/perform.c,v
retrieving revision 1.49
diff -u -r1.49 perform.c
--- usr.sbin/pkg_install/info/perform.c	14 May 2002 21:42:37 -0000	1.49
+++ usr.sbin/pkg_install/info/perform.c	10 Jul 2002 22:06:22 -0000
@@ -254,7 +254,7 @@
 	asprintf(&resolved_path, "%s/", pathname);
 
     if (resolved_path == NULL)
-	errx(2, NULL);
+	errx(2, "asprintf");
 
     if (cwd != NULL)
 	free(cwd);    
@@ -291,7 +291,7 @@
 
     asprintf(&temp, "%s/%s", cwd, current);
     if (temp == NULL)
-        errx(2, NULL);
+        errx(2, "asprintf");
 
     /*
      * Make sure there's no multiple /'s or other weird things in the PLIST,

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207102215.g6AMFDJ9075934>