diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-12-14 19:48:00 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-12-17 09:37:57 -0700 |
commit | b35e4f8b3f15f0474d08f63e1f479787e261f485 (patch) | |
tree | ca07deb80a4d6e4b354a789c65f249d1294fd321 /mg.c | |
parent | 7e9966717022674c08e69f89778c2939c432ddf1 (diff) | |
download | perl-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 |