refcnt: refcnt is unsigned, fix comparisons

This does not make a difference, but the code was confusing.
This commit is contained in:
Tom Gundersen
2015-01-13 23:03:11 +01:00
parent ab5e3a1bcc
commit f0c4b1c3fd
9 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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;