diff options
author | Francis Dupont <fdupont@isc.org> | 2015-11-17 16:36:19 +0100 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2015-11-17 16:36:19 +0100 |
commit | bf673d217b4abe6a84b68859686d50034fcbe486 (patch) | |
tree | 8b4a1e227c2a64212ae4965b3880ee1a6eaa5198 /relay | |
parent | d1d1da8fff09cea21ad2a7c22412e199542e83d2 (diff) | |
download | isc-dhcp-bf673d217b4abe6a84b68859686d50034fcbe486.tar.gz |
Unmerged #38692
Diffstat (limited to 'relay')
-rw-r--r-- | relay/dhcrelay.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c index 67933de1..15b49976 100644 --- a/relay/dhcrelay.c +++ b/relay/dhcrelay.c @@ -30,7 +30,6 @@ #include <syslog.h> #include <signal.h> #include <sys/time.h> -#include <isc/file.h> TIME default_lease_time = 43200; /* 12 hours... */ TIME max_lease_time = 86400; /* 24 hours... */ @@ -141,17 +140,15 @@ static const char message[] = static const char url[] = "For info, please visit https://www.isc.org/software/dhcp/"; -char *progname; - #ifdef DHCPv6 #define DHCRELAY_USAGE \ -"Usage: %s [-4] [-d] [-q] [-a] [-D]\n"\ +"Usage: dhcrelay [-4] [-d] [-q] [-a] [-D]\n"\ " [-A <length>] [-c <hops>] [-p <port>]\n" \ " [-pf <pid-file>] [--no-pid]\n"\ " [-m append|replace|forward|discard]\n" \ " [-i interface0 [ ... -i interfaceN]\n" \ " server0 [ ... serverN]\n\n" \ -" %s -6 [-d] [-q] [-I] [-c <hops>] [-p <port>]\n" \ +" dhcrelay -6 [-d] [-q] [-I] [-c <hops>] [-p <port>]\n" \ " [-pf <pid-file>] [--no-pid]\n" \ " [-s <subscriber-id>]\n" \ " -l lower0 [ ... -l lowerN]\n" \ @@ -160,7 +157,7 @@ char *progname; " upper (server link): [address%%]interface" #else #define DHCRELAY_USAGE \ -"Usage: %s [-d] [-q] [-a] [-D] [-A <length>] [-c <hops>] [-p <port>]\n" \ +"Usage: dhcrelay [-d] [-q] [-a] [-D] [-A <length>] [-c <hops>] [-p <port>]\n" \ " [-pf <pid-file>] [--no-pid]\n" \ " [-m append|replace|forward|discard]\n" \ " [-i interface0 [ ... -i interfaceN]\n" \ @@ -168,11 +165,7 @@ char *progname; #endif static void usage() { - log_fatal(DHCRELAY_USAGE, -#ifdef DHCPv6 - isc_file_basename(progname), -#endif - isc_file_basename(progname)); + log_fatal(DHCRELAY_USAGE); } int @@ -191,12 +184,6 @@ main(int argc, char **argv) { int local_family_set = 0; #endif -#ifdef OLD_LOG_NAME - progname = "dhcrelay"; -#else - progname = argv[0]; -#endif - /* Make sure that file descriptors 0(stdin), 1,(stdout), and 2(stderr) are open. To do this, we assume that when we open a file the lowest available file descriptor is used. */ @@ -210,7 +197,7 @@ main(int argc, char **argv) { else if (fd != -1) close(fd); - openlog(isc_file_basename(progname), DHCP_LOG_OPTIONS, LOG_DAEMON); + openlog("dhcrelay", DHCP_LOG_OPTIONS, LOG_DAEMON); #if !defined(DEBUG) setlogmask(LOG_UPTO(LOG_INFO)); @@ -401,11 +388,7 @@ main(int argc, char **argv) { exit(0); } else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) { - log_info(DHCRELAY_USAGE, -#ifdef DHCPv6 - isc_file_basename(progname), -#endif - isc_file_basename(progname)); + log_info(DHCRELAY_USAGE); exit(0); } else if (argv[i][0] == '-') { usage(); |