From owner-freebsd-bugs@FreeBSD.ORG Tue Mar 30 10:40:08 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8701106566B for ; Tue, 30 Mar 2010 10:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8D42C8FC19 for ; Tue, 30 Mar 2010 10:40:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o2UAe8Q0009060 for ; Tue, 30 Mar 2010 10:40:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o2UAe8bv009059; Tue, 30 Mar 2010 10:40:08 GMT (envelope-from gnats) Date: Tue, 30 Mar 2010 10:40:08 GMT Message-Id: <201003301040.o2UAe8bv009059@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Ruslan Ermilov Cc: Subject: Re: bin/144644: [patch] Fix *alloc cornercases with config(1) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ruslan Ermilov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 10:40:08 -0000 The following reply was made to PR bin/144644; it has been noted by GNATS. From: Ruslan Ermilov To: Garrett Cooper Cc: bug-followup@FreeBSD.org Subject: Re: bin/144644: [patch] Fix *alloc cornercases with config(1) Date: Tue, 30 Mar 2010 14:34:26 +0400 On Sun, Mar 21, 2010 at 04:58:18AM -0700, Garrett Cooper wrote: > On Sat, Mar 13, 2010 at 12:36 AM, Garrett Cooper wrote: > > On Fri, Mar 12, 2010 at 11:28 PM, Garrett Cooper wrote: > >>    The attached patch addresses the non-style(9) conformity with my > >> previous patch as pointed out by several folks on current@. > > > > Sorry -- missed a spot... > > The following patch incorporates a logical change from errx(3) to > err(3) made by ru@ in an informal review. I also picked up a few other > logical messages that were originally errx(EXIT_ERR, ...) and > converted them to err(EXIT_ERR, ...) in a similar fashion. Part of the changes are invalid (shouldn't have been converted from errx() to err()). : Index: main.c : =================================================================== : --- main.c (revision 205872) : +++ main.c (working copy) : @@ -120,7 +120,7 @@ : if (*destdir == '\0') : strlcpy(destdir, optarg, sizeof(destdir)); : else : - errx(2, "directory already set"); : + err(EXIT_FAILURE, "directory already set"); : break; : case 'g': : debugging++; : @@ -175,7 +175,7 @@ : if (mkdir(p, 0777)) : err(2, "%s", p); : } else if (!S_ISDIR(buf.st_mode)) : - errx(2, "%s isn't a directory", p); : + err(EXIT_FAILURE, "%s isn't a directory", p); : : SLIST_INIT(&cputype); : SLIST_INIT(&mkopt); : @@ -519,7 +519,7 @@ : */ : p = strstr(kernconfstr, KERNCONFTAG); : if (p == NULL) : - errx(EXIT_FAILURE, "Something went terribly wrong!"); : + err(EXIT_FAILURE, "Something went terribly wrong!"); : *p = '\0'; : fprintf(fo, "%s", kernconfstr); : fprintf(fo, "%s", sbuf_data(sb)); : @@ -671,19 +673,19 @@ : [...] : if (S_ISDIR(st.st_mode)) : - errx(EXIT_FAILURE, "'%s' is a directory", file); : + err(EXIT_FAILURE, "'%s' is a directory", file); : fp = fdopen(r, "r"); : [...] : pp = popen(cmd, "r"); : if (pp == NULL) : - errx(EXIT_FAILURE, "popen() failed"); : + err(EXIT_FAILURE, "popen() failed"); This is questionable; see the popen(3) manpage for details, section ERRORS. : Index: lang.l : =================================================================== : --- lang.l (revision 205872) : +++ lang.l (working copy) : @@ -31,6 +31,7 @@ : * $FreeBSD$ : */ : : +#include Misplaced include. : #include : #include : #include Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer