diff options
author | Lubomir Rintel <lubo.rintel@gooddata.com> | 2010-07-26 16:05:05 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-07-26 16:06:25 +0200 |
commit | d016601746b09e0f0a7eb2148b6eb594d3992339 (patch) | |
tree | 4e1ca2a5523dea59a0931cafbbbb4bcd93dcb10a /mg.c | |
parent | 1e8125c621275d18c74bc8dae3bfc3c03929fe1e (diff) | |
download | perl-d016601746b09e0f0a7eb2148b6eb594d3992339.tar.gz |
Restore errno if signal handler changes it
It's way too easy to forget to "local $!" in signal handlers and
changing $! when signal hits between two ops is probably never useful.
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1385,6 +1385,7 @@ Perl_despatch_signals(pTHX) PL_sig_pending = 0; for (sig = 1; sig < SIG_SIZE; sig++) { if (PL_psig_pend[sig]) { + dSAVE_ERRNO; PERL_BLOCKSIG_ADD(set, sig); PL_psig_pend[sig] = 0; PERL_BLOCKSIG_BLOCK(set); @@ -1394,6 +1395,7 @@ Perl_despatch_signals(pTHX) (*PL_sighandlerp)(sig); #endif PERL_BLOCKSIG_UNBLOCK(set); + RESTORE_ERRNO; } } } |