aboutsummaryrefslogtreecommitdiff
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2018-06-25 01:29:54 +0000
committerEitan Adler <eadler@FreeBSD.org>2018-06-25 01:29:54 +0000
commitb537db698cd4bf459e6ba02beef3d3faea214837 (patch)
treed5178a1f2ce936c4ed7686fdca6291ce8a0e17c5 /sbin/dhclient
parentadcd95974d1c50b0f3add0e5de2f416e4a69cb2f (diff)
downloadsrc-b537db698cd4bf459e6ba02beef3d3faea214837.tar.gz
src-b537db698cd4bf459e6ba02beef3d3faea214837.zip
dhclient: recorrect __progname to getprogname()
A more correct way to modernize code that uses __progname is to just replace each occurance of it with a call to getprogname(3) Reported by: ian Reviewed by: imp
Notes
Notes: svn path=/head/; revision=335612
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/dhclient.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index c92b5f1dd132..f28558d164f0 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -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);
}