From 69374fe705978962b85217f3eb828a93f836fd8d Mon Sep 17 00:00:00 2001 From: Zefram Date: Sat, 11 Nov 2017 23:58:32 +0000 Subject: 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] --- perl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'perl.c') 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) -- cgit v1.2.1