RE: change #25688
John E. Malmberg wrote:
H.Merijn Brand wrote:
On 04 Oct 2005 02:18:27 -0700, Gisle Aas <[EMAIL PROTECTED]> wrote:
This patch expand on Ken's by getting rid of STATUS_NATIVE_SET() for
the non-VMS branch and renames STATUS_NATIVE_EXPORT as STATUS_EXIT
since the value is only derived from STATUS_NATIVE on VMS. I think it
should leve the VMS behaviour intact, but I have no way to check that
out. If the STATUS_NATIVE_SET(h_errno) code in pp_sys.c is active on
VMS you might want to check that it still works as expected.
This patch also make assignments to $? (aka STATUS_UNIX) not update
$^CHILD_ERROR_NATIVE any more, as there is no portable way to get that
right and not even meaningful since the semantics of $? depends on
context.
I also tested this patch on HP-UX 11i/64 with threads, just to be sure :)
All tests passed.
This seems to have broken several tests on VMS.
ok 3 - Normal exit ${^CHILD_ERROR_NATIVE}
# Failed at [-.t.run]exit.t line 98
# got '1024'
# expected '0'
# Failed at [-.t.run]exit.t line 99
# got '4'
# expected '1'
not ok 4 - PERL success exit
T/RUN/EXIT....FAILED at test 4
lib/Pod/t/Usage...........................FAILED at test 6
ok 5 - -pathlist parameter
# cmd = dskwld$dka100:[project_root.][perl-blead.t]perl.;1 "-I../lib"
"-MPod::Us
age" -e "pod2usage({ -verbose => 0, -exit => 2, -output => q{_NLA0:},
-input
=> q{[-.lib.pod.t]usage.t} })"
not ok 6 - Exit status of pod2usage()
lib/Test/Simple/t/is_deeply_fail..........FAILED at test 73
not ok 73 - right diagnostic
LIB/TEST/SIMPLE/T/IS_DEEPLY_FAIL....FAILED at test 73
t/pod/pod2usage2..........................FAILED at test 2
#EXIT=22 OUTPUT=+++##+++
not ok 2 - Exit status pod2usage ()
T/POD/POD2USAGE2....FAILED at test 2
This may take a while for me to untangle. STATUS_NATIVE_EXPORT which is
now STATUS_EXIT was always somewhat incorrect on VMS, but I left it on
my last pass through so that I did not break existing code that was
dependent on that behavior.
As long as STATUS_NATIVE_EXPORT was only used for the final exit status
of Perl, it did not hurt too much.
This change seems to have forced the several routines that were
translating the status correctly on VMS to use STATUS_EXIT which is
basically resulting a number of success status values being translated
to a fatal error condition instead of being passed through.
I am not sure that I can untangle this so that the old somewhat broken
VMS exit behavior is completely preserved.
One of the big problems is that sometimes the "status" value has a VMS
status, and sometimes it has a UNIX status, and sometimes it has a flag
indicating to look in another set of locations for the real UNIX or VMS
statuses. This code was written before the POSIX and NATIVE status
values were separated, and I am not sure that all cases have been fixed.
If the POSIX status value is EVMSERR, then the native VMS status should
be in VAX$ERRNO.
If a routine return value is -1 or NULL, then the true VMS status should
be obtained by back translating errno, which is a routine that needs to
be written.
-1 is never a legal native status value on VMS, so it's presence means
that either the error locations are uninitialized, or that it is a UNIX
status code, so in that case errno should contain the real UNIX code,
and if errno == EVMSERR, then vaxc$errno has the UNIX status code.
And POSIX errno codes on VMS should only be from 0 to 255, because
otherwise they overflow into the child status byte, so -1 should never
show up there either.
And since the error locations should never be uninitialized, it should
only show up as a native or POSIX status from a bug.
And that is why fixing it to preserve the old behavior may be hard, as I
do not know which bug is causing -1 to show up as a VMS status or get
set into errno.
If you have a VMS native status, and need a POSIX status, the routine
vms_status_to_unix() is the only way that it will be translated correctly.
And it is one of the things that must be fixed in order to get Perl and
GNV to play together.
-John
[EMAIL PROTECTED]
Personal Opinion Only