mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-01 14:55:30 +00:00
Update for 19054 - modifications to keep GCC 4.3 happy
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
DHCP Client. */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004-2008 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 1995-2003 by Internet Software Consortium
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
@@ -62,10 +62,10 @@ struct data_string default_duid;
|
||||
assert (state_is == state_shouldbe). */
|
||||
#define ASSERT_STATE(state_is, state_shouldbe) {}
|
||||
|
||||
static char copyright[] = "Copyright 2004-2008 Internet Systems Consortium.";
|
||||
static char arr [] = "All rights reserved.";
|
||||
static char message [] = "Internet Systems Consortium DHCP Client";
|
||||
static char url [] = "For info, please visit http://www.isc.org/sw/dhcp/";
|
||||
static const char copyright[] = "Copyright 2004-2009 Internet Systems Consortium.";
|
||||
static const char arr [] = "All rights reserved.";
|
||||
static const char message [] = "Internet Systems Consortium DHCP Client";
|
||||
static const char url [] = "For info, please visit http://www.isc.org/sw/dhcp/";
|
||||
|
||||
u_int16_t local_port = 0;
|
||||
u_int16_t remote_port = 0;
|
||||
@@ -3295,7 +3295,7 @@ void go_daemon ()
|
||||
|
||||
write_client_pid_file ();
|
||||
|
||||
chdir("/");
|
||||
IGNORE_RET (chdir("/"));
|
||||
}
|
||||
|
||||
void write_client_pid_file ()
|
||||
|
@@ -3,7 +3,7 @@
|
||||
Common parser code for dhcpd and dhclient. */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004-2008 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 1995-2003 by Internet Software Consortium
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
@@ -5674,14 +5674,14 @@ int parse_warn (struct parse *cfile, const char *fmt, ...)
|
||||
#endif
|
||||
|
||||
if (log_perror) {
|
||||
write (STDERR_FILENO, mbuf, strlen (mbuf));
|
||||
write (STDERR_FILENO, "\n", 1);
|
||||
write (STDERR_FILENO, cfile -> token_line,
|
||||
strlen (cfile -> token_line));
|
||||
write (STDERR_FILENO, "\n", 1);
|
||||
IGNORE_RET (write (STDERR_FILENO, mbuf, strlen (mbuf)));
|
||||
IGNORE_RET (write (STDERR_FILENO, "\n", 1));
|
||||
IGNORE_RET (write (STDERR_FILENO, cfile -> token_line,
|
||||
strlen (cfile -> token_line)));
|
||||
IGNORE_RET (write (STDERR_FILENO, "\n", 1));
|
||||
if (cfile -> lexchar < 81)
|
||||
write (STDERR_FILENO, lexbuf, lix);
|
||||
write (STDERR_FILENO, "^\n", 2);
|
||||
IGNORE_RET (write (STDERR_FILENO, lexbuf, lix));
|
||||
IGNORE_RET (write (STDERR_FILENO, "^\n", 2));
|
||||
}
|
||||
|
||||
cfile -> warnings_occurred = 1;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
Turn data structures into printable text. */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 2004-2007,2009 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 1995-2003 by Internet Software Consortium
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
@@ -308,7 +308,7 @@ void dump_raw (buf, len)
|
||||
lbuf[54]=' ';
|
||||
lbuf[55]=' ';
|
||||
lbuf[73]='\0';
|
||||
log_info (lbuf);
|
||||
log_info ("%s", lbuf);
|
||||
}
|
||||
memset(lbuf, ' ', 79);
|
||||
lbuf [79] = 0;
|
||||
@@ -332,7 +332,7 @@ void dump_raw (buf, len)
|
||||
lbuf[54]=' ';
|
||||
lbuf[55]=' ';
|
||||
lbuf[73]='\0';
|
||||
log_info (lbuf);
|
||||
log_info ("%s", lbuf);
|
||||
}
|
||||
|
||||
void hash_dump (table)
|
||||
|
@@ -62,7 +62,7 @@ test_buffer_allocate(void) {
|
||||
|
||||
struct buffer *buf;
|
||||
|
||||
t_assert("buffer_allocate", 1, T_REQUIRED, test_desc);
|
||||
t_assert("buffer_allocate", 1, T_REQUIRED, "%s", test_desc);
|
||||
|
||||
/*
|
||||
* Check a 0-length buffer.
|
||||
@@ -118,7 +118,7 @@ test_buffer_reference(void) {
|
||||
|
||||
struct buffer *a, *b;
|
||||
|
||||
t_assert("buffer_reference", 1, T_REQUIRED, test_desc);
|
||||
t_assert("buffer_reference", 1, T_REQUIRED, "%s", test_desc);
|
||||
|
||||
/*
|
||||
* Create a buffer.
|
||||
@@ -189,7 +189,7 @@ test_buffer_dereference(void) {
|
||||
|
||||
struct buffer *a, *b;
|
||||
|
||||
t_assert("buffer_dereference", 1, T_REQUIRED, test_desc);
|
||||
t_assert("buffer_dereference", 1, T_REQUIRED, "%s", test_desc);
|
||||
|
||||
/*
|
||||
* Confirm buffer_dereference() doesn't work if we pass in NULL.
|
||||
@@ -283,7 +283,7 @@ test_data_string_forget(void) {
|
||||
struct data_string a;
|
||||
const char *str = "Lorem ipsum dolor sit amet turpis duis.";
|
||||
|
||||
t_assert("data_string_forget", 1, T_REQUIRED, test_desc);
|
||||
t_assert("data_string_forget", 1, T_REQUIRED, "%s", test_desc);
|
||||
|
||||
/*
|
||||
* Create the string we want to forget.
|
||||
@@ -351,7 +351,7 @@ test_data_string_forget_nobuf(void) {
|
||||
struct data_string a;
|
||||
const char *str = "Lorem ipsum dolor sit amet massa nunc.";
|
||||
|
||||
t_assert("data_string_forget, no buffer", 1, T_REQUIRED, test_desc);
|
||||
t_assert("data_string_forget, no buffer", 1, T_REQUIRED, "%s", test_desc);
|
||||
|
||||
/*
|
||||
* Create the string we want to forget.
|
||||
@@ -395,7 +395,7 @@ test_data_string_copy(void) {
|
||||
struct data_string a, b;
|
||||
const char *str = "Lorem ipsum dolor sit amet orci aliquam.";
|
||||
|
||||
t_assert("data_string_copy", 1, T_REQUIRED, test_desc);
|
||||
t_assert("data_string_copy", 1, T_REQUIRED, "%s", test_desc);
|
||||
|
||||
|
||||
/*
|
||||
@@ -452,7 +452,8 @@ test_data_string_copy_nobuf(void) {
|
||||
struct data_string a, b;
|
||||
const char *str = "Lorem ipsum dolor sit amet cras amet.";
|
||||
|
||||
t_assert("data_string_copy, no buffer", 1, T_REQUIRED, test_desc);
|
||||
t_assert("data_string_copy, no buffer", 1, T_REQUIRED, "%s",
|
||||
test_desc);
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -23,6 +23,13 @@ if test "$GCC" = "yes"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
|
||||
# parts of the IPv6 Advanced Socket API as a result. This is stupid
|
||||
# as it breaks how the two halves (Basic and Advanced) of the IPv6
|
||||
# Socket API were designed to be used but we have to live with it.
|
||||
# Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
AC_PROG_RANLIB
|
||||
AC_CONFIG_HEADERS([includes/config.h])
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
#ifndef LINT
|
||||
static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.6 2007/11/30 21:51:43 fdupont Exp $";
|
||||
static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.7 2009/01/22 00:43:58 sar Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
|
||||
* Portions Copyright (c) 2007 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Portions Copyright (c) 2007,2009 by Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* Permission to use, copy modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -545,7 +545,11 @@ dst_s_read_public_key(const char *in_name, const unsigned in_id, int in_alg)
|
||||
return (NULL);
|
||||
}
|
||||
/* read in the key string */
|
||||
fgets(enckey, sizeof(enckey), fp);
|
||||
if ((fgets(enckey, sizeof(enckey), fp) == NULL) &&
|
||||
(ferror(fp) != 0)) {
|
||||
EREPORT(("dst_read_public_kety(): Error reading key\n"));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* If we aren't at end-of-file, something is wrong. */
|
||||
while ((c = getc(fp)) != EOF)
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 RadioMail Corporation. All rights reserved.
|
||||
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 2004,2009 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 1996-2003 by Internet Software Consortium
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
@@ -54,4 +54,23 @@
|
||||
#define ANSI_DECL(x)
|
||||
#define INLINE
|
||||
#endif /* __GNUC__ || __STDC__ */
|
||||
|
||||
/* The following macro handles the case of unwanted return values. In
|
||||
* GCC one can specify an attribute for a function to generate a warning
|
||||
* if the return value of the function is ignored and one can't dispose of
|
||||
* the warning by the use of void. In conjunction with the use of -Werror
|
||||
* these warnings prohibit the compilation of the package. This macro
|
||||
* allows us to assign the return value to a variable and then ignore it.
|
||||
*/
|
||||
#if !defined(__GNUC__) || (__GNUC__ < 4) || \
|
||||
((__GNUC__ == 4) && (__GNUC_MINOR__ < 3))
|
||||
#define IGNORE_RET(x) (void) x
|
||||
#else
|
||||
#define IGNORE_RET(x) \
|
||||
do { \
|
||||
int ignore_return; \
|
||||
ignore_return = x; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#endif /* __ISC_DHCP_CDEFS_H__ */
|
||||
|
@@ -22,6 +22,9 @@
|
||||
/* Define to include Failover Protocol support. */
|
||||
#undef FAILOVER_PROTOCOL
|
||||
|
||||
/* Define to 1 if you need the _GNU_SOURCE flag defined */
|
||||
#undef _GNU_SOURCE
|
||||
|
||||
/* Define to 1 if you have the /dev/random file. */
|
||||
#undef HAVE_DEV_RANDOM
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 RadioMail Corporation.
|
||||
* Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 1996-2003 by Internet Software Consortium
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
@@ -70,8 +70,8 @@ void log_fatal (const char * fmt, ... )
|
||||
|
||||
/* Also log it to stderr? */
|
||||
if (log_perror) {
|
||||
write (STDERR_FILENO, mbuf, strlen (mbuf));
|
||||
write (STDERR_FILENO, "\n", 1);
|
||||
IGNORE_RET (write (STDERR_FILENO, mbuf, strlen (mbuf)));
|
||||
IGNORE_RET (write (STDERR_FILENO, "\n", 1));
|
||||
}
|
||||
|
||||
#if !defined (NOMINUM)
|
||||
@@ -118,8 +118,8 @@ int log_error (const char * fmt, ...)
|
||||
#endif
|
||||
|
||||
if (log_perror) {
|
||||
write (STDERR_FILENO, mbuf, strlen (mbuf));
|
||||
write (STDERR_FILENO, "\n", 1);
|
||||
IGNORE_RET (write (STDERR_FILENO, mbuf, strlen (mbuf)));
|
||||
IGNORE_RET (write (STDERR_FILENO, "\n", 1));
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -145,8 +145,8 @@ int log_info (const char *fmt, ...)
|
||||
#endif
|
||||
|
||||
if (log_perror) {
|
||||
write (STDERR_FILENO, mbuf, strlen (mbuf));
|
||||
write (STDERR_FILENO, "\n", 1);
|
||||
IGNORE_RET (write (STDERR_FILENO, mbuf, strlen (mbuf)));
|
||||
IGNORE_RET (write (STDERR_FILENO, "\n", 1));
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -172,8 +172,8 @@ int log_debug (const char *fmt, ...)
|
||||
#endif
|
||||
|
||||
if (log_perror) {
|
||||
write (STDERR_FILENO, mbuf, strlen (mbuf));
|
||||
write (STDERR_FILENO, "\n", 1);
|
||||
IGNORE_RET (write (STDERR_FILENO, mbuf, strlen (mbuf)));
|
||||
IGNORE_RET (write (STDERR_FILENO, "\n", 1));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
DHCP/BOOTP Relay Agent. */
|
||||
|
||||
/*
|
||||
* Copyright(c) 2004-2008 by Internet Systems Consortium, Inc.("ISC")
|
||||
* Copyright(c) 2004-2009 by Internet Systems Consortium, Inc.("ISC")
|
||||
* Copyright(c) 1997-2003 by Internet Software Consortium
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
@@ -126,10 +126,13 @@ static int strip_relay_agent_options(struct interface_info *,
|
||||
struct interface_info **,
|
||||
struct dhcp_packet *, unsigned);
|
||||
|
||||
static char copyright[] = "Copyright 2004-2008 Internet Systems Consortium.";
|
||||
static char arr[] = "All rights reserved.";
|
||||
static char message[] = "Internet Systems Consortium DHCP Relay Agent";
|
||||
static char url[] = "For info, please visit http://www.isc.org/sw/dhcp/";
|
||||
static const char copyright[] =
|
||||
"Copyright 2004-2009 Internet Systems Consortium.";
|
||||
static const char arr[] = "All rights reserved.";
|
||||
static const char message[] =
|
||||
"Internet Systems Consortium DHCP Relay Agent";
|
||||
static const char url[] =
|
||||
"For info, please visit http://www.isc.org/sw/dhcp/";
|
||||
|
||||
#ifdef DHCPv6
|
||||
#define DHCRELAY_USAGE \
|
||||
@@ -531,7 +534,7 @@ main(int argc, char **argv) {
|
||||
close(2);
|
||||
pid = setsid();
|
||||
|
||||
chdir("/");
|
||||
IGNORE_RET (chdir("/"));
|
||||
}
|
||||
|
||||
/* Set up the packet handler... */
|
||||
|
@@ -3,7 +3,7 @@
|
||||
DHCP Server Daemon. */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004-2008 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 1996-2003 by Internet Software Consortium
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
@@ -32,11 +32,12 @@
|
||||
* ``http://www.nominum.com''.
|
||||
*/
|
||||
|
||||
static char copyright[] =
|
||||
"Copyright 2004-2008 Internet Systems Consortium.";
|
||||
static char arr [] = "All rights reserved.";
|
||||
static char message [] = "Internet Systems Consortium DHCP Server";
|
||||
static char url [] = "For info, please visit http://www.isc.org/sw/dhcp/";
|
||||
static const char copyright[] =
|
||||
"Copyright 2004-2009 Internet Systems Consortium.";
|
||||
static const char arr [] = "All rights reserved.";
|
||||
static const char message [] = "Internet Systems Consortium DHCP Server";
|
||||
static const char url [] =
|
||||
"For info, please visit http://www.isc.org/sw/dhcp/";
|
||||
|
||||
#include "dhcpd.h"
|
||||
#include <omapip/omapip_p.h>
|
||||
@@ -783,7 +784,7 @@ main(int argc, char **argv) {
|
||||
/* Write new pid file. */
|
||||
if ((i = open(path_dhcpd_pid, O_WRONLY|O_CREAT|O_TRUNC, 0644)) >= 0) {
|
||||
sprintf(pbuf, "%d\n", (int) getpid());
|
||||
write(i, pbuf, strlen(pbuf));
|
||||
IGNORE_RET (write(i, pbuf, strlen(pbuf)));
|
||||
close(i);
|
||||
} else {
|
||||
log_error("Can't create PID file %s: %m.", path_dhcpd_pid);
|
||||
@@ -812,7 +813,7 @@ main(int argc, char **argv) {
|
||||
open("/dev/null", O_RDWR);
|
||||
log_perror = 0; /* No sense logging to /dev/null. */
|
||||
|
||||
chdir("/");
|
||||
IGNORE_RET (chdir("/"));
|
||||
}
|
||||
#endif /* !DEBUG */
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 1999-2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: t_api.c,v 1.2 2007/11/16 11:04:12 shane Exp $ */
|
||||
/* $Id: t_api.c,v 1.3 2009/01/22 00:43:58 sar Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#endif /* BIND_SUPPORT */
|
||||
|
||||
#include "t_api.h"
|
||||
#include "cdefs.h"
|
||||
|
||||
static const char *Usage =
|
||||
"\t-a : run all tests\n"
|
||||
@@ -245,7 +246,7 @@ main(int argc, char **argv) {
|
||||
*/
|
||||
|
||||
if (T_dir != NULL)
|
||||
(void) chdir(T_dir);
|
||||
IGNORE_RET (chdir(T_dir));
|
||||
|
||||
/*
|
||||
* We don't want buffered output.
|
||||
|
Reference in New Issue
Block a user