summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-24 00:10:35 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-24 17:27:53 +0100
commit15e80c7b75c3a3188bfaaa0baddccf31ae661a7a (patch)
treeb1ef4c1988abc0a5479e7e3f57be9cc7697c4370 /src
parentce06fdfb3de7a6591041828361f8d10c04a4677e (diff)
id128: add new sd_id128_is_null() call
Diffstat (limited to 'src')
-rw-r--r--src/systemd/sd-id128.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/systemd/sd-id128.h b/src/systemd/sd-id128.h
index 48fd87671b..9f445278bb 100644
--- a/src/systemd/sd-id128.h
+++ b/src/systemd/sd-id128.h
@@ -106,6 +106,10 @@ _sd_pure_ static inline int sd_id128_equal(sd_id128_t a, sd_id128_t b) {
return memcmp(&a, &b, 16) == 0;
}
+_sd_pure_ static inline int sd_id128_is_null(sd_id128_t a) {
+ return a.qwords[0] == 0 && a.qwords[1] == 0;
+}
+
#define SD_ID128_NULL ((const sd_id128_t) { .qwords = { 0, 0 }})
_SD_END_DECLARATIONS;