diff options
author | Tom Gundersen <teg@jklm.no> | 2015-01-13 23:03:11 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-01-13 23:03:11 +0100 |
commit | f0c4b1c3fd827b429ba36aa45fd39e0a023cbf2c (patch) | |
tree | acf63f10a03907abe79c07a6ff4dd25fb4371409 /src/libsystemd-network | |
parent | ab5e3a1bccaf79d65c93fc15ddeaa7595ffe0b86 (diff) |
refcnt: refcnt is unsigned, fix comparisons
This does not make a difference, but the code was confusing.
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-client.c | 2 | ||||
-rw-r--r-- | src/libsystemd-network/sd-dhcp-lease.c | 2 | ||||
-rw-r--r-- | src/libsystemd-network/sd-dhcp6-client.c | 2 | ||||
-rw-r--r-- | src/libsystemd-network/sd-dhcp6-lease.c | 2 | ||||
-rw-r--r-- | src/libsystemd-network/sd-icmp6-nd.c | 2 | ||||
-rw-r--r-- | src/libsystemd-network/sd-ipv4ll.c | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index c8a724f27e..dbecad4d9c 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -1672,7 +1672,7 @@ sd_dhcp_client *sd_dhcp_client_ref(sd_dhcp_client *client) { } sd_dhcp_client *sd_dhcp_client_unref(sd_dhcp_client *client) { - if (client && REFCNT_DEC(client->n_ref) <= 0) { + if (client && REFCNT_DEC(client->n_ref) == 0) { log_dhcp_client(client, "FREE"); client_initialize(client); diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c index 22a4af6837..00fef164b0 100644 --- a/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/libsystemd-network/sd-dhcp-lease.c @@ -193,7 +193,7 @@ sd_dhcp_lease *sd_dhcp_lease_ref(sd_dhcp_lease *lease) { } sd_dhcp_lease *sd_dhcp_lease_unref(sd_dhcp_lease *lease) { - if (lease && REFCNT_DEC(lease->n_ref) <= 0) { + if (lease && REFCNT_DEC(lease->n_ref) == 0) { free(lease->hostname); free(lease->domainname); free(lease->dns); diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 017371e837..2bbed7d91f 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -1254,7 +1254,7 @@ sd_dhcp6_client *sd_dhcp6_client_ref(sd_dhcp6_client *client) { } sd_dhcp6_client *sd_dhcp6_client_unref(sd_dhcp6_client *client) { - if (client && REFCNT_DEC(client->n_ref) <= 0) { + if (client && REFCNT_DEC(client->n_ref) == 0) { client_reset(client); sd_dhcp6_client_detach_event(client); diff --git a/src/libsystemd-network/sd-dhcp6-lease.c b/src/libsystemd-network/sd-dhcp6-lease.c index 8960fac92f..78e1589286 100644 --- a/src/libsystemd-network/sd-dhcp6-lease.c +++ b/src/libsystemd-network/sd-dhcp6-lease.c @@ -195,7 +195,7 @@ sd_dhcp6_lease *sd_dhcp6_lease_ref(sd_dhcp6_lease *lease) { } sd_dhcp6_lease *sd_dhcp6_lease_unref(sd_dhcp6_lease *lease) { - if (lease && REFCNT_DEC(lease->n_ref) <= 0) { + if (lease && REFCNT_DEC(lease->n_ref) == 0) { free(lease->serverid); dhcp6_lease_free_ia(&lease->ia); diff --git a/src/libsystemd-network/sd-icmp6-nd.c b/src/libsystemd-network/sd-icmp6-nd.c index fbaf093ad8..d2bff8fcf6 100644 --- a/src/libsystemd-network/sd-icmp6-nd.c +++ b/src/libsystemd-network/sd-icmp6-nd.c @@ -145,7 +145,7 @@ static int icmp6_nd_init(sd_icmp6_nd *nd) { } sd_icmp6_nd *sd_icmp6_nd_unref(sd_icmp6_nd *nd) { - if (nd && REFCNT_DEC(nd->n_ref) <= 0) { + if (nd && REFCNT_DEC(nd->n_ref) == 0) { icmp6_nd_init(nd); sd_icmp6_nd_detach_event(nd); diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index 8626d4afa9..02f2f9e0a9 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -605,7 +605,7 @@ sd_ipv4ll *sd_ipv4ll_ref(sd_ipv4ll *ll) { } sd_ipv4ll *sd_ipv4ll_unref(sd_ipv4ll *ll) { - if (ll && REFCNT_DEC(ll->n_ref) <= 0) { + if (ll && REFCNT_DEC(ll->n_ref) == 0) { ll->receive_message = sd_event_source_unref(ll->receive_message); ll->fd = safe_close(ll->fd); |