summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2019-11-12 11:28:21 +0000
committerDavid Mitchell <davem@iabyn.com>2019-11-18 09:34:40 +0000
commitfff75fa71c1ed83f6c8e5a0940c5170b67a0e9e1 (patch)
treea6638c3f2e766296e413a9f15f2b3835fc2dd433 /mg.c
parent8d61efc53a54233fb943fb2453732400f5e79d18 (diff)
downloadperl-fff75fa71c1ed83f6c8e5a0940c5170b67a0e9e1.tar.gz
Perl_perly_sighandler: combine two conditions
The branch is only taken if a number of conditions are true. Combine them into a single if statement, with the sip test first, so that an unnecessary call to sigaction() may be skipped if its only going to immediately fail afterwards because sip isn't true. Shouldn't be any change in functionality.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/mg.c b/mg.c
index 9424698991..71f650cece 100644
--- a/mg.c
+++ b/mg.c
@@ -3494,8 +3494,7 @@ Perl_perly_sighandler(int sig, Siginfo_t *sip PERL_UNUSED_DECL,
{
struct sigaction oact;
- if (sigaction(sig, 0, &oact) == 0 && oact.sa_flags & SA_SIGINFO) {
- if (sip) {
+ if (sip && sigaction(sig, 0, &oact) == 0 && oact.sa_flags & SA_SIGINFO) {
HV *sih = newHV();
SV *rv = newRV_noinc(MUTABLE_SV(sih));
/* The siginfo fields signo, code, errno, pid, uid,
@@ -3527,7 +3526,6 @@ Perl_perly_sighandler(int sig, Siginfo_t *sip PERL_UNUSED_DECL,
EXTEND(SP, 2);
PUSHs(rv);
mPUSHp((char *)sip, sizeof(*sip));
- }
}
}