summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-09-28 04:25:13 +0200
committerLennart Poettering <lennart@poettering.net>2011-09-28 04:34:17 +0200
commitfb9de93dd3587e62e0fc0413673c98ea709c5a2f (patch)
tree96baa58676cc78e41db18901ea6b16dfad783f7f /src/util.c
parent958ae0d75176a65dc6694829667a5cc9fead8cbc (diff)
localed: add SetX11Keyboard() and SetVConsoleKeyboard() bus calls
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 425a732344..7977ee46c5 100644
--- a/src/util.c
+++ b/src/util.c
@@ -5682,3 +5682,21 @@ bool kexec_loaded(void) {
}
return loaded;
}
+
+int strdup_or_null(const char *a, char **b) {
+ char *c;
+
+ assert(b);
+
+ if (!a) {
+ *b = NULL;
+ return 0;
+ }
+
+ c = strdup(a);
+ if (!c)
+ return -ENOMEM;
+
+ *b = c;
+ return 0;
+}