From 0bd721763436e6b156eebcf94492525631801668 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 10 Jul 2024 17:14:17 +0200 Subject: signal-util: use common definitions for ignore + default "struct sigaction" We use this at various places, let's unify this in one global constant. This changes flags in crash-handler.c in a tiny irrelevant way: we ask syscalls to be continued on signal arrival, which we previously didn't. But that shouldn't change anything, the only thing we'll do in the relevant process is call raise(), and that's it, hence there definitely are no syscalls to restart or not to restart. --- src/tty-ask-password-agent/tty-ask-password-agent.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/tty-ask-password-agent') diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 31b284b502..84ce5e1940 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -548,14 +548,10 @@ static int ask_on_this_console(const char *tty, pid_t *ret_pid, char **arguments .sa_handler = nop_signal_handler, .sa_flags = SA_NOCLDSTOP | SA_RESTART, }; - static const struct sigaction sighup = { - .sa_handler = SIG_DFL, - .sa_flags = SA_RESTART, - }; int r; assert_se(sigaction(SIGCHLD, &sigchld, NULL) >= 0); - assert_se(sigaction(SIGHUP, &sighup, NULL) >= 0); + assert_se(sigaction(SIGHUP, &sigaction_default, NULL) >= 0); assert_se(sigprocmask_many(SIG_UNBLOCK, NULL, SIGHUP, SIGCHLD) >= 0); r = safe_fork("(sd-passwd)", FORK_RESET_SIGNALS|FORK_LOG, ret_pid); -- cgit v1.2.3