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
|
Gilles Bouthenot
|
||||||
Helmut Grohne
|
Helmut Grohne
|
||||||
Joey D.
|
Joey D.
|
||||||
|
Ryan Steinmetz
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,10 @@ gnulib_modules="
|
||||||
fopen
|
fopen
|
||||||
free
|
free
|
||||||
getopt-gnu
|
getopt-gnu
|
||||||
|
inet_pton
|
||||||
langinfo
|
langinfo
|
||||||
netinet_in
|
netinet_in
|
||||||
|
progname
|
||||||
realloc-gnu
|
realloc-gnu
|
||||||
stat
|
stat
|
||||||
stddef
|
stddef
|
||||||
|
|
|
||||||
5
lib/.gitignore
vendored
5
lib/.gitignore
vendored
|
|
@ -3,11 +3,13 @@
|
||||||
/.deps/
|
/.deps/
|
||||||
/.gitignore~
|
/.gitignore~
|
||||||
/.libs/
|
/.libs/
|
||||||
|
/arpa/
|
||||||
/Makefile
|
/Makefile
|
||||||
/Makefile.am
|
/Makefile.am
|
||||||
/Makefile.in
|
/Makefile.in
|
||||||
/_Exit.c
|
/_Exit.c
|
||||||
/arg-nonnull.h
|
/arg-nonnull.h
|
||||||
|
/arpa_inet.in.h
|
||||||
/atexit.c
|
/atexit.c
|
||||||
/c++defs.h
|
/c++defs.h
|
||||||
/c-ctype.c
|
/c-ctype.c
|
||||||
|
|
@ -55,6 +57,7 @@
|
||||||
/getopt1.c
|
/getopt1.c
|
||||||
/getopt_int.h
|
/getopt_int.h
|
||||||
/gettext.h
|
/gettext.h
|
||||||
|
/inet_pton.c
|
||||||
/intprops.h
|
/intprops.h
|
||||||
/langinfo.h
|
/langinfo.h
|
||||||
/langinfo.in.h
|
/langinfo.in.h
|
||||||
|
|
@ -74,6 +77,8 @@
|
||||||
/msvc-nothrow.h
|
/msvc-nothrow.h
|
||||||
/netinet_in.in.h
|
/netinet_in.in.h
|
||||||
/pathmax.h
|
/pathmax.h
|
||||||
|
/progname.c
|
||||||
|
/progname.h
|
||||||
/quote.h
|
/quote.h
|
||||||
/quotearg.c
|
/quotearg.c
|
||||||
/quotearg.h
|
/quotearg.h
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@
|
||||||
#include "closeout.h"
|
#include "closeout.h"
|
||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
#include "dhcpd-pools.h"
|
#include "dhcpd-pools.h"
|
||||||
|
#include "progname.h"
|
||||||
#include "xalloc.h"
|
#include "xalloc.h"
|
||||||
|
|
||||||
/*! \brief Start of execution. Parse options, and call other other
|
/*! \brief Start of execution. Parse options, and call other other
|
||||||
|
|
@ -92,6 +93,7 @@ int main(int argc, char **argv)
|
||||||
};
|
};
|
||||||
|
|
||||||
atexit(close_stdout);
|
atexit(close_stdout);
|
||||||
|
set_program_name(argv[0]);
|
||||||
|
|
||||||
/* FIXME: These allocations should be fully dynamic, e.g., grow
|
/* FIXME: These allocations should be fully dynamic, e.g., grow
|
||||||
* if needed. */
|
* if needed. */
|
||||||
|
|
@ -199,7 +201,7 @@ int main(int argc, char **argv)
|
||||||
default:
|
default:
|
||||||
errx(EXIT_FAILURE,
|
errx(EXIT_FAILURE,
|
||||||
"Try `%s --help' for more information.",
|
"Try `%s --help' for more information.",
|
||||||
program_invocation_short_name);
|
program_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,12 @@
|
||||||
|
|
||||||
#include "dhcpd-pools.h"
|
#include "dhcpd-pools.h"
|
||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
|
#include "progname.h"
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
@ -282,7 +285,7 @@ void __attribute__ ((__noreturn__)) usage(int status)
|
||||||
fprintf(out, "\
|
fprintf(out, "\
|
||||||
Usage: %s [OPTIONS]\n\n\
|
Usage: %s [OPTIONS]\n\n\
|
||||||
This is ISC dhcpd pools usage analyzer.\n\
|
This is ISC dhcpd pools usage analyzer.\n\
|
||||||
\n", program_invocation_short_name);
|
\n", program_name);
|
||||||
fprintf(out, "\
|
fprintf(out, "\
|
||||||
-c, --config=FILE path to the dhcpd.conf file\n\
|
-c, --config=FILE path to the dhcpd.conf file\n\
|
||||||
-l, --leases=FILE path to the dhcpd.leases file\n");
|
-l, --leases=FILE path to the dhcpd.leases file\n");
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
|
|
||||||
#include "close-stream.h"
|
#include "close-stream.h"
|
||||||
#include "dhcpd-pools.h"
|
#include "dhcpd-pools.h"
|
||||||
|
#include "progname.h"
|
||||||
#include "strftime.h"
|
#include "strftime.h"
|
||||||
|
|
||||||
/*! \brief Text output format, which is the default.
|
/*! \brief Text output format, which is the default.
|
||||||
|
|
@ -1063,11 +1064,11 @@ int output_alarming(void)
|
||||||
if (0 < rc || 0 < sc) {
|
if (0 < rc || 0 < sc) {
|
||||||
ret_val = 2;
|
ret_val = 2;
|
||||||
fprintf(outfile, "CRITICAL: %s: ",
|
fprintf(outfile, "CRITICAL: %s: ",
|
||||||
program_invocation_short_name);
|
program_name);
|
||||||
} else if (0 < rw || 0 < sw) {
|
} else if (0 < rw || 0 < sw) {
|
||||||
ret_val = 1;
|
ret_val = 1;
|
||||||
fprintf(outfile, "WARNING: %s: ",
|
fprintf(outfile, "WARNING: %s: ",
|
||||||
program_invocation_short_name);
|
program_name);
|
||||||
} else {
|
} else {
|
||||||
ret_val = 0;
|
ret_val = 0;
|
||||||
fprintf(outfile, "OK: ");
|
fprintf(outfile, "OK: ");
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "dhcpd-pools.h"
|
#include "dhcpd-pools.h"
|
||||||
|
#include "progname.h"
|
||||||
|
|
||||||
/*! \brief Compare IP address, with IPv4/v6 determination.
|
/*! \brief Compare IP address, with IPv4/v6 determination.
|
||||||
* \param a Binary IP address.
|
* \param a Binary IP address.
|
||||||
|
|
@ -216,7 +217,7 @@ comparer_t field_selector(char c)
|
||||||
default:
|
default:
|
||||||
warnx("field_selector: unknown sort order `%c'", c);
|
warnx("field_selector: unknown sort order `%c'", c);
|
||||||
errx(EXIT_FAILURE, "Try `%s --help' for more information.",
|
errx(EXIT_FAILURE, "Try `%s --help' for more information.",
|
||||||
program_invocation_short_name);
|
program_name);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue