From c74f17d96cccd4cc998fd037cb92046930188c91 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 20 Jul 2012 00:00:04 +0200 Subject: 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. --- src/core/swap.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/core/swap.c') diff --git a/src/core/swap.c b/src/core/swap.c index 03993b1e60..91bb0215b1 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -1260,7 +1260,7 @@ static void swap_reset_failed(Unit *u) { s->result = SWAP_SUCCESS; } -static int swap_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError *error) { +static int swap_kill(Unit *u, KillWho who, int signo, DBusError *error) { Swap *s = SWAP(u); int r = 0; Set *pid_set = NULL; @@ -1282,23 +1282,25 @@ static int swap_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError * if (kill(s->control_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 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; } + } 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: -- cgit v1.2.3-54-g00ecf