.sa_flags = SA_RESTART,
};
+const struct sigaction sigaction_nop_nocldstop = {
+ .sa_handler = nop_signal_handler,
+ .sa_flags = SA_NOCLDSTOP|SA_RESTART,
+};
+
int parse_signo(const char *s, int *ret) {
int sig, r;
extern const struct sigaction sigaction_ignore;
extern const struct sigaction sigaction_default;
+extern const struct sigaction sigaction_nop_nocldstop;
int parse_signo(const char *s, int *ret);
LOG_MESSAGE("Caught <%s>, not dumping core.", signal_to_string(sig)),
"MESSAGE_ID=" SD_MESSAGE_CRASH_NO_COREDUMP_STR);
else {
- sa = (struct sigaction) {
- .sa_handler = nop_signal_handler,
- .sa_flags = SA_NOCLDSTOP|SA_RESTART,
- };
-
/* We want to wait for the core process, hence let's enable SIGCHLD */
- (void) sigaction(SIGCHLD, &sa, NULL);
+ (void) sigaction(SIGCHLD, &sigaction_nop_nocldstop, NULL);
pid = raw_clone(SIGCHLD);
if (pid < 0)
pid_t *pid,
int *ret) {
- static const struct sigaction sa = {
- .sa_handler = nop_signal_handler,
- .sa_flags = SA_NOCLDSTOP|SA_RESTART,
- };
-
_cleanup_(release_lock_file) LockFile uid_shift_lock = LOCK_FILE_INIT;
_cleanup_close_ int etc_passwd_lock = -EBADF;
_cleanup_close_pair_ int
if (r < 0)
return log_error_errno(errno, "Failed to change the signal mask: %m");
- r = sigaction(SIGCHLD, &sa, NULL);
+ r = sigaction(SIGCHLD, &sigaction_nop_nocldstop, NULL);
if (r < 0)
return log_error_errno(errno, "Failed to install SIGCHLD handler: %m");
* terminated.
*/
static int ask_on_this_console(const char *tty, pid_t *ret_pid, char **arguments) {
- static const struct sigaction sigchld = {
- .sa_handler = nop_signal_handler,
- .sa_flags = SA_NOCLDSTOP | SA_RESTART,
- };
int r;
- assert_se(sigaction(SIGCHLD, &sigchld, NULL) >= 0);
+ assert_se(sigaction(SIGCHLD, &sigaction_nop_nocldstop, NULL) >= 0);
assert_se(sigaction(SIGHUP, &sigaction_default, NULL) >= 0);
assert_se(sigprocmask_many(SIG_UNBLOCK, NULL, SIGHUP, SIGCHLD) >= 0);