summaryrefslogtreecommitdiff
path: root/src/core/dbus-kill.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-08 11:27:28 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:32 +0200
commit6eb7c172b58d81a5f6c3998ce304a7324fc65050 (patch)
treea720b0f860bc65bfc09cbbafe869b2974d7d0c16 /src/core/dbus-kill.c
parent4c310c073aec5a31a7e626ea8ceb86d3a28291aa (diff)
tree-wide: add new SIGNAL_VALID() macro-like function that validates signal numbers
And port all code over to use it.
Diffstat (limited to 'src/core/dbus-kill.c')
-rw-r--r--src/core/dbus-kill.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/dbus-kill.c b/src/core/dbus-kill.c
index fc50fafaad..0f54c6b84b 100644
--- a/src/core/dbus-kill.c
+++ b/src/core/dbus-kill.c
@@ -58,7 +58,7 @@ int bus_kill_context_set_transient_property(
k = kill_mode_from_string(m);
if (k < 0)
- return -EINVAL;
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Kill mode '%s' not known.", m);
if (mode != UNIT_CHECK) {
c->kill_mode = k;
@@ -75,7 +75,7 @@ int bus_kill_context_set_transient_property(
if (r < 0)
return r;
- if (sig <= 0 || sig >= _NSIG)
+ if (!SIGNAL_VALID(sig))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Signal %i out of range", sig);
if (mode != UNIT_CHECK) {