summaryrefslogtreecommitdiff
path: root/src/core/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-07-20 00:00:04 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-20 00:10:32 +0200
commitc74f17d96cccd4cc998fd037cb92046930188c91 (patch)
tree6de40f861594f7042dddac66c492b5047d0c3f91 /src/core/service.c
parent4819ff0358b6317c195fd4b1768e03d09c871070 (diff)
core: drop KillMode parameter from KillUnit() bus call
It made no sense, and since we are documenting the bus calls now and want to include them in our stability promise we really should get it cleaned up sooner, not later.
Diffstat (limited to 'src/core/service.c')
-rw-r--r--src/core/service.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 567e9a4eb3..78f9a59c7f 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -3673,7 +3673,7 @@ static void service_reset_failed(Unit *u) {
RATELIMIT_RESET(s->start_limit);
}
-static int service_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError *error) {
+static int service_kill(Unit *u, KillWho who, int signo, DBusError *error) {
Service *s = SERVICE(u);
int r = 0;
Set *pid_set = NULL;
@@ -3700,28 +3700,33 @@ static int service_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusErro
if (kill(s->main_pid, signo) < 0)
r = -errno;
- if (who == KILL_ALL && mode == KILL_CONTROL_GROUP) {
+ if (who == KILL_ALL) {
int q;
- if (!(pid_set = set_new(trivial_hash_func, trivial_compare_func)))
+ pid_set = set_new(trivial_hash_func, trivial_compare_func);
+ if (!pid_set)
return -ENOMEM;
/* Exclude the control/main pid from being killed via the cgroup */
- if (s->control_pid > 0)
- if ((q = set_put(pid_set, LONG_TO_PTR(s->control_pid))) < 0) {
+ if (s->control_pid > 0) {
+ q = set_put(pid_set, LONG_TO_PTR(s->control_pid));
+ if (q < 0) {
r = q;
goto finish;
}
+ }
- if (s->main_pid > 0)
- if ((q = set_put(pid_set, LONG_TO_PTR(s->main_pid))) < 0) {
+ if (s->main_pid > 0) {
+ q = set_put(pid_set, LONG_TO_PTR(s->main_pid));
+ if (q < 0) {
r = q;
goto finish;
}
+ }
+
q = cgroup_bonding_kill_list(UNIT(s)->cgroup_bondings, signo, false, false, pid_set, NULL);
- if (q < 0)
- if (q != -EAGAIN && q != -ESRCH && q != -ENOENT)
- r = q;
+ if (q < 0 && q != -EAGAIN && q != -ESRCH && q != -ENOENT)
+ r = q;
}
finish: