core/socket: use correct kill operation for SOCKET_STOP_PRE_SIGTERM

Follow-up for a232ebcc2c
This commit is contained in:
Mike Yuan
2024-12-30 21:43:52 +01:00
parent 2fbdfe0b0d
commit 240457204b
+4 -2
View File
@@ -2104,8 +2104,10 @@ static void socket_enter_stop_post(Socket *s, SocketResult f) {
}
static int state_to_kill_operation(Socket *s, SocketState state) {
if (state == SOCKET_STOP_PRE_SIGTERM && unit_has_job_type(UNIT(s), JOB_RESTART))
return KILL_RESTART;
assert(s);
if (state == SOCKET_STOP_PRE_SIGTERM)
return unit_has_job_type(UNIT(s), JOB_RESTART) ? KILL_RESTART : KILL_TERMINATE;
if (state == SOCKET_FINAL_SIGTERM)
return KILL_TERMINATE;