From owner-svn-src-all@freebsd.org Mon Jun 25 00:36:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D18E5101BAF4 for ; Mon, 25 Jun 2018 00:36:03 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0F983478 for ; Mon, 25 Jun 2018 00:36:03 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.161.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 48FA92665F for ; Mon, 25 Jun 2018 00:36:03 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f181.google.com with SMTP id r19-v6so4191682ywc.10 for ; Sun, 24 Jun 2018 17:36:03 -0700 (PDT) X-Gm-Message-State: APt69E0S8/+54OvzCSd0fWV5xcwDuZH2KQyOqresFLHfCgnqXhUlY01d S0PpU0lGSgC9OylRy/uZ0qjQWRp7KfmKEVwr3pu85w== X-Google-Smtp-Source: ADUXVKKMh1kjqYATGKJM17DlF6rF3lXkqyEV0TC/Ft6F1Vipfg/mXFybj2wYDeE9maUmkoEQbsmJSQi8K5lQMoT64K4= X-Received: by 2002:a0d:cf01:: with SMTP id r1-v6mr4721140ywd.162.1529886962738; Sun, 24 Jun 2018 17:36:02 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sun, 24 Jun 2018 17:35:32 -0700 (PDT) In-Reply-To: <1529850923.24573.69.camel@freebsd.org> References: <201806241323.w5ODNRW2037739@repo.freebsd.org> <1529850923.24573.69.camel@freebsd.org> From: Eitan Adler Date: Sun, 24 Jun 2018 17:35:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335602 - head/sbin/dhclient To: Ian Lepore Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 00:36:04 -0000 On 24 June 2018 at 07:35, Ian Lepore wrote: > On Sun, 2018-06-24 at 13:23 +0000, Eitan Adler wrote: >> Author: eadler >> Date: Sun Jun 24 13:23:27 2018 >> New Revision: 335602 >> URL: https://svnweb.freebsd.org/changeset/base/335602 >> >> Log: >> dhclient: build with WARNS=6 >> >> - add static in a number of places >> - initialize __progname rather than rely on magical extern values >> - use nitems() instead of manually spelling it out >> - unshadow 'idi' >> - teach 'error' that it is '__dead2' >> - add missing 'break' > > The changes related to __progname aren't correct. __progname is a bsd- > ism that goes back to at least 4.4BSD, Thanks! Is this correct then? Index: dhclient.c =================================================================== --- dhclient.c (revision 335611) +++ dhclient.c (working copy) @@ -149,7 +149,6 @@ int fork_privchld(int, int); #define MIN_MTU 68 static time_t scripttime; -static char *__progname; int findproto(char *cp, int n) @@ -379,12 +378,10 @@ main(int argc, char *argv[]) pid_t otherpid; cap_rights_t rights; - __progname = basename(argv[0]); - init_casper(); /* Initially, log errors to stderr as well as to syslogd. */ - cap_openlog(capsyslog, __progname, LOG_PID | LOG_NDELAY, DHCPD_LOG_FACILITY); + cap_openlog(capsyslog, getprogname(), LOG_PID | LOG_NDELAY, DHCPD_LOG_FACILITY); cap_setlogmask(capsyslog, LOG_UPTO(LOG_DEBUG)); while ((ch = getopt(argc, argv, "bc:dl:p:qu")) != -1) @@ -566,7 +563,7 @@ void usage(void) { - fprintf(stderr, "usage: %s [-bdqu] ", __progname); + fprintf(stderr, "usage: %s [-bdqu] ", getprogname()); fprintf(stderr, "[-c conffile] [-l leasefile] interface\n"); exit(1); } -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams