Skip to content

Commit b35e4f8

Browse files
author
Karl Williamson
committed
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.
1 parent 7e99667 commit b35e4f8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mg.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,11 @@ S_fixup_errno_string(pTHX_ SV* sv)
748748
PERL_ARGS_ASSERT_FIXUP_ERRNO_STRING;
749749

750750
assert(SvOK(sv));
751-
assert(strNE(SvPVX(sv), ""));
751+
752+
if(strEQ(SvPVX(sv), "")) {
753+
sv_catpv(sv, UNKNOWN_ERRNO_MSG);
754+
}
755+
else {
752756

753757
/* In some locales the error string may come back as UTF-8, in
754758
* which case we should turn on that flag. This didn't use to
@@ -768,6 +772,7 @@ S_fixup_errno_string(pTHX_ SV* sv)
768772
{
769773
SvUTF8_on(sv);
770774
}
775+
}
771776
}
772777

773778
#ifdef VMS

0 commit comments

Comments
 (0)