diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-11-19 17:21:50 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-11-19 17:21:50 +0000 |
commit | f6c8f21d23f77b9e7ba2d31a3f8ad4502f02ac91 (patch) | |
tree | b40de2abc8bd2cb3f2e4ae980c5663348aba447a /mg.c | |
parent | 858117f827a98da9ad03d6640608dcdd8266902d (diff) | |
download | perl-f6c8f21d23f77b9e7ba2d31a3f8ad4502f02ac91.tar.gz |
Restore errno after having read $^E (like for $!)
to preserve errno from unfortunate side-effects.
p4raw-id: //depot/perl@21743
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -623,8 +623,12 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) SetLastError(dwErr); } #else - sv_setnv(sv, (NV)errno); - sv_setpv(sv, errno ? Strerror(errno) : ""); + { + int saveerrno = errno; + sv_setnv(sv, (NV)errno); + sv_setpv(sv, errno ? Strerror(errno) : ""); + errno = saveerrno; + } #endif #endif #endif |