From b35e4f8b3f15f0474d08f63e1f479787e261f485 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 14 Dec 2013 19:48:00 -0700 Subject: [PATCH] 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. --- mg.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mg.c b/mg.c index d296cbc..45a8ac1 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 -- 2.7.4