summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-22 16:11:50 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-22 16:11:50 +0200
commit8a0867d6c5b47c8697d1ddd815116a548433c718 (patch)
tree56c81885c60e6b23f543d82c91a901d2fde14791 /src/util.c
parent95e501f8ab28e1645453219523c0263754db3f68 (diff)
systemctl: introduce systemctl kill
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 58f67b0d15..cf3cf292a0 100644
--- a/src/util.c
+++ b/src/util.c
@@ -3339,6 +3339,17 @@ DIR *xopendirat(int fd, const char *name) {
return fdopendir(openat(fd, name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC));
}
+int signal_from_string_try_harder(const char *s) {
+ int signo;
+ assert(s);
+
+ if ((signo = signal_from_string(s)) <= 0)
+ if (startswith(s, "SIG"))
+ return signal_from_string(s+3);
+
+ return signo;
+}
+
static const char *const ioprio_class_table[] = {
[IOPRIO_CLASS_NONE] = "none",
[IOPRIO_CLASS_RT] = "realtime",