mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-18 08:47:00 +00:00
gnulib: add gnulib modules
Some systems, such as freebsd, does not have program_invocation_short_name
available. There are also problems finding AF_INET{,6} definitions.
CC: Peter Fraser <p_fraser@hotmail.com>
Reported-by: Ryan Steinmetz <zi@freebsd.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
0002aa57e6
commit
8dba1c749d
7 changed files with 20 additions and 5 deletions
|
|
@ -51,6 +51,7 @@
|
|||
#include "closeout.h"
|
||||
#include "defaults.h"
|
||||
#include "dhcpd-pools.h"
|
||||
#include "progname.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
/*! \brief Start of execution. Parse options, and call other other
|
||||
|
|
@ -92,6 +93,7 @@ int main(int argc, char **argv)
|
|||
};
|
||||
|
||||
atexit(close_stdout);
|
||||
set_program_name(argv[0]);
|
||||
|
||||
/* FIXME: These allocations should be fully dynamic, e.g., grow
|
||||
* if needed. */
|
||||
|
|
@ -199,7 +201,7 @@ int main(int argc, char **argv)
|
|||
default:
|
||||
errx(EXIT_FAILURE,
|
||||
"Try `%s --help' for more information.",
|
||||
program_invocation_short_name);
|
||||
program_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,9 +41,12 @@
|
|||
|
||||
#include "dhcpd-pools.h"
|
||||
#include "defaults.h"
|
||||
#include "progname.h"
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <netinet/in.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
|
@ -282,7 +285,7 @@ void __attribute__ ((__noreturn__)) usage(int status)
|
|||
fprintf(out, "\
|
||||
Usage: %s [OPTIONS]\n\n\
|
||||
This is ISC dhcpd pools usage analyzer.\n\
|
||||
\n", program_invocation_short_name);
|
||||
\n", program_name);
|
||||
fprintf(out, "\
|
||||
-c, --config=FILE path to the dhcpd.conf file\n\
|
||||
-l, --leases=FILE path to the dhcpd.leases file\n");
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
|
||||
#include "close-stream.h"
|
||||
#include "dhcpd-pools.h"
|
||||
#include "progname.h"
|
||||
#include "strftime.h"
|
||||
|
||||
/*! \brief Text output format, which is the default.
|
||||
|
|
@ -1063,11 +1064,11 @@ int output_alarming(void)
|
|||
if (0 < rc || 0 < sc) {
|
||||
ret_val = 2;
|
||||
fprintf(outfile, "CRITICAL: %s: ",
|
||||
program_invocation_short_name);
|
||||
program_name);
|
||||
} else if (0 < rw || 0 < sw) {
|
||||
ret_val = 1;
|
||||
fprintf(outfile, "WARNING: %s: ",
|
||||
program_invocation_short_name);
|
||||
program_name);
|
||||
} else {
|
||||
ret_val = 0;
|
||||
fprintf(outfile, "OK: ");
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "dhcpd-pools.h"
|
||||
#include "progname.h"
|
||||
|
||||
/*! \brief Compare IP address, with IPv4/v6 determination.
|
||||
* \param a Binary IP address.
|
||||
|
|
@ -216,7 +217,7 @@ comparer_t field_selector(char c)
|
|||
default:
|
||||
warnx("field_selector: unknown sort order `%c'", c);
|
||||
errx(EXIT_FAILURE, "Try `%s --help' for more information.",
|
||||
program_invocation_short_name);
|
||||
program_name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue