Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51a7b448 authored by Al Viro's avatar Al Viro
Browse files

new helper: restore_saved_sigmask()



first fruits of ..._restore_sigmask() helpers: now we can take
boilerplate "signal didn't have a handler, clear RESTORE_SIGMASK
and restore the blocked mask from ->saved_mask" into a common
helper.  Open-coded instances switched...

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 4ebefe3e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -572,9 +572,7 @@ do_signal(struct pt_regs * regs, struct switch_stack * sw,
	}

	/* If there's no signal to deliver, we just restore the saved mask.  */
	if (test_and_clear_thread_flag(TIF_RESTORE_SIGMASK))
		set_current_blocked(&current->saved_sigmask);

	restore_saved_sigmask();
	if (single_stepping)
		ptrace_set_bpt(current);	/* re-set breakpoint */
}
+1 −5
Original line number Diff line number Diff line
@@ -663,11 +663,7 @@ static void do_signal(struct pt_regs *regs, int syscall)
			set_thread_flag(TIF_SYSCALL_RESTARTSYS);
	}

	/* If there's no signal to deliver, we just put the saved sigmask
	 * back.
	 */
	if (test_and_clear_thread_flag(TIF_RESTORE_SIGMASK))
		set_current_blocked(&current->saved_sigmask);
	restore_saved_sigmask();
}

asmlinkage void
+1 −4
Original line number Diff line number Diff line
@@ -297,10 +297,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int syscall)

	if (signr == 0) {
		/* No signal to deliver -- put the saved sigmask back */
		if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
			clear_thread_flag(TIF_RESTORE_SIGMASK);
			sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
		}
		restore_saved_sigmask();
		return 0;
	}

+1 −4
Original line number Diff line number Diff line
@@ -319,10 +319,7 @@ asmlinkage void do_signal(struct pt_regs *regs)

	/* if there's no signal to deliver, we just put the saved sigmask
	 * back */
	if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
		clear_thread_flag(TIF_RESTORE_SIGMASK);
		sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
	}
	restore_saved_sigmask();
}

/*
+1 −4
Original line number Diff line number Diff line
@@ -343,10 +343,7 @@ static void do_signal(struct pt_regs *regs, int syscall)

	/* if there's no signal to deliver, we just put the saved sigmask
	 * back */
	if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
		clear_thread_flag(TIF_RESTORE_SIGMASK);
		sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
	}
	restore_saved_sigmask();
}

/*
Loading