chiark / gitweb /
manager: no need to use randomized generator dir when running as system manager
[elogind.git] / src / swap.c
index 035efbaf4b1a941d5cc68adefbd5b3e732a08bc3..c32f60810c0f17444d12861e7080c4e10ed16bac 100644 (file)
@@ -661,9 +661,7 @@ static void swap_enter_signal(Swap *s, SwapState state, bool success) {
                            state == SWAP_DEACTIVATING_SIGTERM) ? s->exec_context.kill_signal : SIGKILL;
 
                 if (s->control_pid > 0) {
-                        if (kill_and_sigcont(s->exec_context.kill_mode == KILL_PROCESS_GROUP ?
-                                             -s->control_pid :
-                                             s->control_pid, sig) < 0 && errno != ESRCH)
+                        if (kill_and_sigcont(s->control_pid, sig) < 0 && errno != ESRCH)
 
                                 log_warning("Failed to kill control process %li: %m", (long) s->control_pid);
                         else
@@ -689,6 +687,7 @@ static void swap_enter_signal(Swap *s, SwapState state, bool success) {
                                 wait_for_exit = true;
 
                         set_free(pid_set);
+                        pid_set = NULL;
                 }
         }
 
@@ -1286,7 +1285,7 @@ static int swap_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError *
         }
 
         if (s->control_pid > 0)
-                if (kill(mode == KILL_PROCESS_GROUP ? -s->control_pid : s->control_pid, signo) < 0)
+                if (kill(s->control_pid, signo) < 0)
                         r = -errno;
 
         if (mode == KILL_CONTROL_GROUP) {