chiark / gitweb /
tmpfiles: don't warn if two identical lines are configured
[elogind.git] / src / socket.c
index 9045a2fc85a3c7c454bcc8ccd4408676bb91236d..beb328657fe5eb34a5d5eabffb4922f837177872 100644 (file)
@@ -1040,9 +1040,7 @@ static void socket_enter_signal(Socket *s, SocketState state, bool success) {
                 int sig = (state == SOCKET_STOP_PRE_SIGTERM || state == SOCKET_FINAL_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
@@ -1068,6 +1066,7 @@ static void socket_enter_signal(Socket *s, SocketState state, bool success) {
                                 wait_for_exit = true;
 
                         set_free(pid_set);
+                        pid_set = NULL;
                 }
         }
 
@@ -1697,6 +1696,7 @@ static void socket_timer_event(Unit *u, uint64_t elapsed, Watch *w) {
         case SOCKET_START_PRE:
                 log_warning("%s starting timed out. Terminating.", u->meta.id);
                 socket_enter_signal(s, SOCKET_FINAL_SIGTERM, false);
+                break;
 
         case SOCKET_START_POST:
                 log_warning("%s starting timed out. Stopping.", u->meta.id);
@@ -1837,7 +1837,7 @@ static int socket_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) {