summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-07 20:27:19 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-07 20:27:19 +0200
commitdb12775d59ab709f8afc361eaa30c9d54a0a8d7c (patch)
treefe361c5e8d4b2d6f1cf54b21917494b488b0ee2f /util.c
parentee9b5e011857ff4a75ceaa9aaf3b2ed8ceacfadf (diff)
util: add chars_intersect() call
Diffstat (limited to 'util.c')
-rw-r--r--util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/util.c b/util.c
index 939b2b06e9..a0f26762dc 100644
--- a/util.c
+++ b/util.c
@@ -1193,6 +1193,17 @@ finish:
return r;
}
+bool chars_intersect(const char *a, const char *b) {
+ const char *p;
+
+ /* Returns true if any of the chars in a are in b. */
+ for (p = a; *p; p++)
+ if (strchr(b, *p))
+ return true;
+
+ return false;
+}
+
static const char *const ioprio_class_table[] = {
[IOPRIO_CLASS_NONE] = "none",
[IOPRIO_CLASS_RT] = "realtime",