summaryrefslogtreecommitdiff
path: root/gdhcp
diff options
context:
space:
mode:
authorGrant Erickson <marathon96@gmail.com>2012-02-28 17:55:52 (GMT)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-03-01 12:45:25 (GMT)
commit7bf4c0642ef6a7c60b382dfb4bc8dab414691e3f (patch)
tree668a84649772ba452513b48d3f15741afc3491f3 /gdhcp
parent95e15c09350acf58d4707056ae2614570883ef66 (diff)
downloadconnman-7bf4c0642ef6a7c60b382dfb4bc8dab414691e3f.zip
connman-7bf4c0642ef6a7c60b382dfb4bc8dab414691e3f.tar.gz
connman-7bf4c0642ef6a7c60b382dfb4bc8dab414691e3f.tar.bz2
dhcpv4-client: Change coding style for passing NULL to time
Pass NULL rather than 0 when calling time(2) to follow prefered stylistic convention.
Diffstat (limited to 'gdhcp')
-rw-r--r--gdhcp/client.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c
index cf4cc3c..d31f0d0 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -584,7 +584,7 @@ int g_dhcpv6_create_duid(GDHCPDuidType duid_type, int index, int type,
get_interface_mac_address(index, &(*duid)[2 + 2 + 4]);
(*duid)[2] = 0;
(*duid)[3] = type;
- duid_time = time(0) - DUID_TIME_EPOCH;
+ duid_time = time(NULL) - DUID_TIME_EPOCH;
(*duid)[4] = duid_time >> 24;
(*duid)[5] = duid_time >> 16;
(*duid)[6] = duid_time >> 8;
@@ -910,7 +910,7 @@ GDHCPClient *g_dhcp_client_new(GDHCPType type,
dhcp_client->require_list = NULL;
dhcp_client->duid = NULL;
dhcp_client->duid_len = 0;
- dhcp_client->last_renew = dhcp_client->last_rebind = time(0);
+ dhcp_client->last_renew = dhcp_client->last_rebind = time(NULL);
dhcp_client->expire = 0;
*error = G_DHCP_CLIENT_ERROR_NONE;
@@ -2569,7 +2569,7 @@ void g_dhcpv6_client_reset_renew(GDHCPClient *dhcp_client)
if (dhcp_client == NULL || dhcp_client->type == G_DHCP_IPV4)
return;
- dhcp_client->last_renew = time(0);
+ dhcp_client->last_renew = time(NULL);
}
void g_dhcpv6_client_reset_rebind(GDHCPClient *dhcp_client)
@@ -2577,7 +2577,7 @@ void g_dhcpv6_client_reset_rebind(GDHCPClient *dhcp_client)
if (dhcp_client == NULL || dhcp_client->type == G_DHCP_IPV4)
return;
- dhcp_client->last_rebind = time(0);
+ dhcp_client->last_rebind = time(NULL);
}
void g_dhcpv6_client_set_expire(GDHCPClient *dhcp_client, uint32_t timeout)
@@ -2585,7 +2585,7 @@ void g_dhcpv6_client_set_expire(GDHCPClient *dhcp_client, uint32_t timeout)
if (dhcp_client == NULL || dhcp_client->type == G_DHCP_IPV4)
return;
- dhcp_client->expire = time(0) + timeout;
+ dhcp_client->expire = time(NULL) + timeout;
}
uint16_t g_dhcpv6_client_get_status(GDHCPClient *dhcp_client)