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 | |
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')
-rw-r--r-- | src/libsystemd/sd-hwdb/sd-hwdb.c | 2 | ||||
-rw-r--r-- | src/libsystemd/sd-rtnl/rtnl-message.c | 2 | ||||
-rw-r--r-- | src/libsystemd/sd-rtnl/sd-rtnl.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd/sd-hwdb/sd-hwdb.c b/src/libsystemd/sd-hwdb/sd-hwdb.c index 7444ab5f12..a16807f9d5 100644 --- a/src/libsystemd/sd-hwdb/sd-hwdb.c +++ b/src/libsystemd/sd-hwdb/sd-hwdb.c @@ -344,7 +344,7 @@ _public_ sd_hwdb *sd_hwdb_ref(sd_hwdb *hwdb) { } _public_ sd_hwdb *sd_hwdb_unref(sd_hwdb *hwdb) { - if (hwdb && REFCNT_DEC(hwdb->n_ref) <= 0) { + if (hwdb && REFCNT_DEC(hwdb->n_ref) == 0) { if (hwdb->map) munmap((void *)hwdb->map, hwdb->st.st_size); if (hwdb->f) diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index a089fae044..06a7a4b83a 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -586,7 +586,7 @@ sd_rtnl_message *sd_rtnl_message_ref(sd_rtnl_message *m) { } sd_rtnl_message *sd_rtnl_message_unref(sd_rtnl_message *m) { - if (m && REFCNT_DEC(m->n_ref) <= 0) { + if (m && REFCNT_DEC(m->n_ref) == 0) { unsigned i; free(m->hdr); diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c index a45ca5e9f5..5778ea53c0 100644 --- a/src/libsystemd/sd-rtnl/sd-rtnl.c +++ b/src/libsystemd/sd-rtnl/sd-rtnl.c @@ -187,7 +187,7 @@ sd_rtnl *sd_rtnl_unref(sd_rtnl *rtnl) { assert_return(!rtnl_pid_changed(rtnl), NULL); - if (REFCNT_DEC(rtnl->n_ref) <= 0) { + if (REFCNT_DEC(rtnl->n_ref) == 0) { struct match_callback *f; unsigned i; |