summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@pobox.com>2008-11-26 15:01:41 -0800
committerSteve Hay <SteveHay@planit.com>2008-12-05 18:11:56 +0000
commit4ee3916907333148e2c880a1f5aeba348c349925 (patch)
treeba07e244427cccdd6ed01277665634498770058c /mg.c
parent33839f2f0661d0502f129769a85cfcf904354d39 (diff)
downloadperl-4ee3916907333148e2c880a1f5aeba348c349925.tar.gz
standardize save/restore of errno & vaxc$errno
Message-ID: <20081127070141.GD17663@tytlal.topaz.cx> p4raw-id: //depot/perl@35018
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mg.c b/mg.c
index 6f4cc5805b..7acff5190f 100644
--- a/mg.c
+++ b/mg.c
@@ -817,10 +817,10 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
}
#else
{
- const int saveerrno = errno;
+ dSAVE_ERRNO;
sv_setnv(sv, (NV)errno);
sv_setpv(sv, errno ? Strerror(errno) : "");
- errno = saveerrno;
+ RESTORE_ERRNO;
}
#endif
SvRTRIM(sv);
@@ -1036,7 +1036,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
sv_setpv(sv, errno ? Strerror(errno) : "");
#else
{
- const int saveerrno = errno;
+ dSAVE_ERRNO;
sv_setnv(sv, (NV)errno);
#ifdef OS2
if (errno == errno_isOS2 || errno == errno_isOS2_set)
@@ -1044,7 +1044,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
else
#endif
sv_setpv(sv, errno ? Strerror(errno) : "");
- errno = saveerrno;
+ RESTORE_ERRNO;
}
#endif
SvRTRIM(sv);