summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-11-11 23:58:32 +0000
committerZefram <zefram@fysh.org>2017-11-11 23:58:32 +0000
commit69374fe705978962b85217f3eb828a93f836fd8d (patch)
tree35cdfe3f00740ca6ee7540d3b02ac5e04d7e1f7e /perl.c
parentb8897079199ab3165b21ca3aff78c7479842181a (diff)
downloadperl-69374fe705978962b85217f3eb828a93f836fd8d.tar.gz
avoid reading errno twice in a row
Reading errno can involve calling a function and indirecting through its result, so cache the value of errno where possible. [perl #122096]
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index bf48b31493..d50bac7cc4 100644
--- a/perl.c
+++ b/perl.c
@@ -5231,8 +5231,9 @@ Perl_my_failure_exit(pTHX)
#else
int exitstatus;
- if (errno & 255)
- STATUS_UNIX_SET(errno);
+ int eno = errno;
+ if (eno & 255)
+ STATUS_UNIX_SET(eno);
else {
exitstatus = STATUS_UNIX >> 8;
if (exitstatus & 255)