chiark / gitweb /
dbus: properly generate UnknownInterface, UnknownProperty and PropertyReadOnly errors
[elogind.git] / src / util.c
index 4acb3c305c0f7d612573558e7104b98895ad7ec2..c02b39e0ad5fb896d1c80977328b9762b2678e3c 100644 (file)
@@ -4079,6 +4079,19 @@ int kill_and_sigcont(pid_t pid, int sig) {
         return r;
 }
 
+bool nulstr_contains(const char*nulstr, const char *needle) {
+        const char *i;
+
+        if (!nulstr)
+                return false;
+
+        NULSTR_FOREACH(i, nulstr)
+                if (streq(i, needle))
+                        return true;
+
+        return false;
+}
+
 static const char *const ioprio_class_table[] = {
         [IOPRIO_CLASS_NONE] = "none",
         [IOPRIO_CLASS_RT] = "realtime",