From f0c4b1c3fd827b429ba36aa45fd39e0a023cbf2c Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 13 Jan 2015 23:03:11 +0100 Subject: refcnt: refcnt is unsigned, fix comparisons This does not make a difference, but the code was confusing. --- src/libsystemd/sd-hwdb/sd-hwdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsystemd/sd-hwdb') 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) -- cgit v1.2.3-54-g00ecf