summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Erickson <marathon96@gmail.com>2012-02-28 09:55:53 -0800
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-03-01 13:45:25 +0100
commit02e24d57300da7571990d066d7e14bb56bdfc2c7 (patch)
tree2970e9c75034291672f5b047e5a909b8f5a022e4
parent7bf4c0642ef6a7c60b382dfb4bc8dab414691e3f (diff)
downloadconnman-02e24d57300da7571990d066d7e14bb56bdfc2c7.tar.gz
connman-02e24d57300da7571990d066d7e14bb56bdfc2c7.tar.bz2
connman-02e24d57300da7571990d066d7e14bb56bdfc2c7.zip
core: Change coding style for passing NULL to time
Pass NULL rather than 0 when calling time(2) to follow prefered stylistic convention.
-rw-r--r--src/dhcpv6.c6
-rw-r--r--src/dnsproxy.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/src/dhcpv6.c b/src/dhcpv6.c
index aab58686..462b78d7 100644
--- a/src/dhcpv6.c
+++ b/src/dhcpv6.c
@@ -606,7 +606,7 @@ static int check_restart(struct connman_dhcpv6 *dhcp)
g_dhcpv6_client_get_timeouts(dhcp->dhcp_client, NULL, NULL,
NULL, NULL, &expired);
- current = time(0);
+ current = time(NULL);
if (current > expired) {
DBG("expired by %d secs", (int)(current - expired));
@@ -816,7 +816,7 @@ int __connman_dhcpv6_start_renew(struct connman_network *network,
g_dhcpv6_client_get_timeouts(dhcp->dhcp_client, &T1, &T2,
&last_renew, &last_rebind, &expired);
- current = time(0);
+ current = time(NULL);
DBG("T1 %u T2 %u expires %lu current %lu", T1, T2,
(unsigned long)expired, current);
@@ -1207,7 +1207,7 @@ int __connman_dhcpv6_init(void)
{
DBG("");
- srand(time(0));
+ srand(time(NULL));
network_table = g_hash_table_new_full(g_direct_hash, g_direct_equal,
NULL, remove_network);
diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index dc44a46d..e0b8da21 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -565,7 +565,7 @@ static gboolean cache_check_is_valid(struct cache_data *data,
*/
static void cache_enforce_validity(struct cache_entry *entry)
{
- time_t current_time = time(0);
+ time_t current_time = time(NULL);
if (cache_check_is_valid(entry->ipv4, current_time) == FALSE
&& entry->ipv4) {
@@ -588,7 +588,7 @@ static void cache_enforce_validity(struct cache_entry *entry)
static uint16_t cache_check_validity(char *question, uint16_t type,
struct cache_entry *entry)
{
- time_t current_time = time(0);
+ time_t current_time = time(NULL);
int want_refresh = 0;
/*
@@ -1053,7 +1053,7 @@ static void cache_cleanup(void)
struct cache_timeout data;
int count = 0;
- data.current_time = time(0);
+ data.current_time = time(NULL);
data.max_timeout = 0;
data.try_harder = 0;
@@ -1230,7 +1230,7 @@ static int cache_update(struct server_data *srv, unsigned char *msg,
return 0;
}
- current_time = time(0);
+ current_time = time(NULL);
/* don't do a cache refresh more than twice a minute */
if (next_refresh < current_time) {
@@ -1416,7 +1416,7 @@ static int ns_resolv(struct server_data *server, struct request_data *req,
data = entry->ipv6;
if (data) {
- ttl_left = data->valid_until - time(0);
+ ttl_left = data->valid_until - time(NULL);
entry->hits++;
}