From: Roy Marples Date: Wed, 7 Nov 2007 20:59:52 +0000 (+0000) Subject: timeval defines seconds as long, so we should use long over time_t X-Git-Tag: v3.2.3~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=348016d0ac49d1252d523c362940a2aa1e7e4e2f;p=thirdparty%2Fdhcpcd.git timeval defines seconds as long, so we should use long over time_t --- diff --git a/arp.c b/arp.c index f6624026..3d446a71 100644 --- a/arp.c +++ b/arp.c @@ -5,6 +5,7 @@ * Distributed under the terms of the GNU General Public License v2 */ +#include #include #include #include diff --git a/client.c b/client.c index a5efd4ee..707bb6cb 100644 --- a/client.c +++ b/client.c @@ -9,9 +9,9 @@ # define _BSD_SOURCE #endif +#include #include #include -#include #include #ifdef __linux__ # include @@ -164,7 +164,7 @@ static pid_t daemonise (int *pidfd) #ifdef ENABLE_INFO static bool get_old_lease (const options_t *options, interface_t *iface, - dhcp_t *dhcp, time_t *timeout) + dhcp_t *dhcp, long *timeout) { struct timeval tv; unsigned int offset = 0; @@ -226,7 +226,7 @@ int dhcp_run (const options_t *options, int *pidfd) int state = STATE_INIT; struct timeval tv; int xid = 0; - time_t timeout = 0; + long timeout = 0; fd_set rset; int maxfd; int retval; @@ -236,13 +236,13 @@ int dhcp_run (const options_t *options, int *pidfd) int last_type = DHCP_DISCOVER; bool daemonised = options->daemonised; bool persistent = options->persistent; - time_t start = 0; - time_t last_send = 0; + long start = 0; + long last_send = 0; int sig; unsigned char *buffer = NULL; int buffer_len = 0; int buffer_pos = 0; - time_t nakoff = 1; + long nakoff = 1; if (! options || (iface = (read_interface (options->interface, options->metric))) == NULL) @@ -707,7 +707,7 @@ int dhcp_run (const options_t *options, int *pidfd) /* If we constantly get NAKS then we should slowly back off */ if (nakoff > 0) { - logger (LOG_DEBUG, "sleeping for %d seconds", nakoff); + logger (LOG_DEBUG, "sleeping for %ld seconds", nakoff); tv.tv_sec = nakoff; tv.tv_usec = 0; nakoff *= 2; diff --git a/common.c b/common.c index 4fa3e52d..8aedb8d6 100644 --- a/common.c +++ b/common.c @@ -121,7 +121,7 @@ int get_time (struct timeval *tp) #endif } -time_t uptime (void) +long uptime (void) { struct timeval tp; diff --git a/common.h b/common.h index 7f77e6db..c622b5d6 100644 --- a/common.h +++ b/common.h @@ -9,7 +9,6 @@ #define COMMON_H /* string.h pulls in features.h so the below define checks work */ -#include #include /* Only GLIBC doesn't support strlcpy */ @@ -25,7 +24,7 @@ void srandomdev (void); void close_fds (void); int get_time (struct timeval *tp); -time_t uptime (void); +long uptime (void); void writepid (int fd, pid_t pid); void *xmalloc (size_t size); char *xstrdup (const char *str);