diff --git a/src/basic/util.c b/src/basic/util.c index c788a1d58b3..f7e4aefebb0 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -6916,3 +6916,7 @@ int receive_one_fd(int transport_fd, int flags) { return *(int*) CMSG_DATA(found); } + +void nop_signal_handler(int sig) { + /* nothing here */ +} diff --git a/src/basic/util.h b/src/basic/util.h index e6417b4ccd5..96811f23d9d 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -944,3 +944,5 @@ int fgetxattr_malloc(int fd, const char *name, char **value); int send_one_fd(int transport_fd, int fd, int flags); int receive_one_fd(int transport_fd, int flags); + +void nop_signal_handler(int sig); diff --git a/src/core/main.c b/src/core/main.c index dac233e84d9..76abb0bde90 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -115,8 +115,6 @@ static bool arg_default_blockio_accounting = false; static bool arg_default_memory_accounting = false; static bool arg_default_tasks_accounting = false; -static void nop_handler(int sig) {} - static void pager_open_if_enabled(void) { if (arg_no_pager <= 0) @@ -134,7 +132,7 @@ noreturn static void crash(int sig) { log_emergency("Caught <%s>, not dumping core.", signal_to_string(sig)); else { struct sigaction sa = { - .sa_handler = nop_handler, + .sa_handler = nop_signal_handler, .sa_flags = SA_NOCLDSTOP|SA_RESTART, }; pid_t pid; diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index cb4e87fd74c..6b5d5d5b756 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2282,8 +2282,6 @@ static int wait_for_container(pid_t pid, ContainerStatus *container) { return r; } -static void nop_handler(int sig) {} - static int on_orderly_shutdown(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) { pid_t pid; @@ -3241,7 +3239,7 @@ int main(int argc, char *argv[]) { ContainerStatus container_status; _cleanup_(barrier_destroy) Barrier barrier = BARRIER_NULL; static const struct sigaction sa = { - .sa_handler = nop_handler, + .sa_handler = nop_signal_handler, .sa_flags = SA_NOCLDSTOP, }; int ifi = 0;