summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-12-14 19:48:00 -0700
committerKarl Williamson <public@khwilliamson.com>2013-12-17 09:37:57 -0700
commitb35e4f8b3f15f0474d08f63e1f479787e261f485 (patch)
treeca07deb80a4d6e4b354a789c65f249d1294fd321 /mg.c
parent7e9966717022674c08e69f89778c2939c432ddf1 (diff)
downloadperl-b35e4f8b3f15f0474d08f63e1f479787e261f485.tar.gz
Fix HP-UX $! failure
HP-UX strerror() returns an empty string for an unknown error code. This caused an assertion to fail under DEBUGGING builds. This patch removes the assertion and changes the return into a non-empty string indicating the errno is for an unknown error.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index d296cbc341..45a8ac1691 100644
--- a/mg.c
+++ b/mg.c
@@ -748,7 +748,11 @@ S_fixup_errno_string(pTHX_ SV* sv)
PERL_ARGS_ASSERT_FIXUP_ERRNO_STRING;
assert(SvOK(sv));
- assert(strNE(SvPVX(sv), ""));
+
+ if(strEQ(SvPVX(sv), "")) {
+ sv_catpv(sv, UNKNOWN_ERRNO_MSG);
+ }
+ else {
/* In some locales the error string may come back as UTF-8, in
* which case we should turn on that flag. This didn't use to
@@ -768,6 +772,7 @@ S_fixup_errno_string(pTHX_ SV* sv)
{
SvUTF8_on(sv);
}
+ }
}
#ifdef VMS