From 38d7c791f597c3d567a70466dc2e48b73ec318bf Mon Sep 17 00:00:00 2001 From: Leon Timmermans Date: Mon, 26 Dec 2011 19:06:54 +0200 Subject: [PATCH] Signal handlers must run before sigsuspend returns The whole point of sigsuspend and pause is to wait until a signal has arrived, and then return *after* it has been triggered. Currently delayed/"safe" signals prevent that from happening, which might cause race conditions. This patch prevents that (as far as possible) by running the signal handlers ASAP. Petr Pisar: Back-ported to 5.14.2. --- ext/POSIX/POSIX.xs | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 8dc1f5a..4b9779b 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -1550,6 +1550,8 @@ sigaction(sig, optaction, oldaction = 0) SysRet sigpending(sigset) POSIX::SigSet sigset + CLEANUP: + PERL_ASYNC_CHECK(); SysRet sigprocmask(how, sigset, oldsigset = 0) @@ -2019,6 +2021,8 @@ pathconf(filename, name) SysRet pause() + CLEANUP: + PERL_ASYNC_CHECK(); SysRet setgid(gid) -- 1.7.7.6