mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-18 00:37:01 +00:00
portability: Solaris 10 does not have err.h
Use error(3) function, that has gnulib portability fixes, instead of err(3) and warn(3) family. Reported-by: Anton Tkachev <antont@bk.ru> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
fae20302cf
commit
535dfc4fc2
10 changed files with 84 additions and 72 deletions
19
src/other.c
19
src/other.c
|
|
@ -39,13 +39,9 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "dhcpd-pools.h"
|
||||
#include "defaults.h"
|
||||
#include "progname.h"
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <netinet/in.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
|
@ -53,7 +49,12 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "error.h"
|
||||
#include "progname.h"
|
||||
|
||||
#include "dhcpd-pools.h"
|
||||
#include "defaults.h"
|
||||
|
||||
/*! \brief Set function pointers depending on IP version.
|
||||
* \param ip IP version.
|
||||
|
|
@ -378,9 +379,7 @@ double strtod_or_err(const char *restrict str, const char *restrict errmesg)
|
|||
goto err;
|
||||
return num;
|
||||
err:
|
||||
if (errno)
|
||||
err(EXIT_FAILURE, "%s: '%s'", errmesg, str);
|
||||
errx(EXIT_FAILURE, "%s: '%s'", errmesg, str);
|
||||
error(EXIT_FAILURE, errno, "%s: '%s'", errmesg, str);
|
||||
}
|
||||
|
||||
/*! \brief Reverse range.
|
||||
|
|
@ -404,7 +403,7 @@ void clean_up(void)
|
|||
{
|
||||
/* Just in case there something in buffers */
|
||||
if (fflush(NULL))
|
||||
warn("clean_up: fflush");
|
||||
error(0, 0, "clean_up: fflush");
|
||||
free(config.dhcpdconf_file);
|
||||
free(config.dhcpdlease_file);
|
||||
free(config.output_file);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue