mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 07: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
1
THANKS
1
THANKS
|
|
@ -27,3 +27,4 @@ Cheer Xiao
|
|||
Gilles Bouthenot
|
||||
Helmut Grohne
|
||||
Joey D.
|
||||
Ryan Steinmetz
|
||||
|
|
|
|||
|
|
@ -27,8 +27,10 @@ gnulib_modules="
|
|||
fopen
|
||||
free
|
||||
getopt-gnu
|
||||
inet_pton
|
||||
langinfo
|
||||
netinet_in
|
||||
progname
|
||||
realloc-gnu
|
||||
stat
|
||||
stddef
|
||||
|
|
|
|||
5
lib/.gitignore
vendored
5
lib/.gitignore
vendored
|
|
@ -3,11 +3,13 @@
|
|||
/.deps/
|
||||
/.gitignore~
|
||||
/.libs/
|
||||
/arpa/
|
||||
/Makefile
|
||||
/Makefile.am
|
||||
/Makefile.in
|
||||
/_Exit.c
|
||||
/arg-nonnull.h
|
||||
/arpa_inet.in.h
|
||||
/atexit.c
|
||||
/c++defs.h
|
||||
/c-ctype.c
|
||||
|
|
@ -55,6 +57,7 @@
|
|||
/getopt1.c
|
||||
/getopt_int.h
|
||||
/gettext.h
|
||||
/inet_pton.c
|
||||
/intprops.h
|
||||
/langinfo.h
|
||||
/langinfo.in.h
|
||||
|
|
@ -74,6 +77,8 @@
|
|||
/msvc-nothrow.h
|
||||
/netinet_in.in.h
|
||||
/pathmax.h
|
||||
/progname.c
|
||||
/progname.h
|
||||
/quote.h
|
||||
/quotearg.c
|
||||
/quotearg.h
|
||||
|
|
|
|||
|
|
@ -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