anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0209-id128-add-new-sd_id128_is_null-call.patch

1ff636
From 69c2ae8ed9bb861a0bc47ce553b1749390009036 Mon Sep 17 00:00:00 2001
1ff636
From: Lennart Poettering <lennart@poettering.net>
1ff636
Date: Tue, 24 Feb 2015 00:10:35 +0100
1ff636
Subject: [PATCH] id128: add new sd_id128_is_null() call
1ff636
1ff636
(cherry picked from commit 15e80c7b75c3a3188bfaaa0baddccf31ae661a7a)
1ff636
1ff636
Cherry-picked from: 15e80c7
1ff636
Resolves: #1222517
1ff636
---
1ff636
 src/systemd/sd-id128.h | 4 ++++
1ff636
 1 file changed, 4 insertions(+)
1ff636
1ff636
diff --git a/src/systemd/sd-id128.h b/src/systemd/sd-id128.h
181b3f
index 48fd87671..9f445278b 100644
1ff636
--- a/src/systemd/sd-id128.h
1ff636
+++ b/src/systemd/sd-id128.h
1ff636
@@ -106,6 +106,10 @@ _sd_pure_ static inline int sd_id128_equal(sd_id128_t a, sd_id128_t b) {
1ff636
         return memcmp(&a, &b, 16) == 0;
1ff636
 }
1ff636
 
1ff636
+_sd_pure_ static inline int sd_id128_is_null(sd_id128_t a) {
1ff636
+        return a.qwords[0] == 0 && a.qwords[1] == 0;
1ff636
+}
1ff636
+
1ff636
 #define SD_ID128_NULL ((const sd_id128_t) { .qwords = { 0, 0 }})
1ff636
 
1ff636
 _SD_END_DECLARATIONS;