Re: Packed executable exit code 1 issue
Roderich Schupp <[email protected]> Mon, 17 Jul 2023 12:30:20 +0200
| Newsgroups | gmane.comp.lang.perl.par |
|---|---|
| Message-ID | <CAC9r9zaV5WDKCdKXC1j8uFe0CqguNwgc+os+YnpzGPmNahg5BQ@mail.gmail.com> |
--000000000000b894070600ac4907 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 7:56=E2=80=AFAM Deepak Khosla via par <[email protected]= > wrote: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > use strict; > use warnings; > my $exit_code =3D $ARGV[0]; > print "called with $0 $exit_code\n"; > > END { > $? =3D $exit_code; # Setting this in case exit is ignoring our exit_code > print STDERR "Exiting final with exit_status $exit_code, ? =3D $? \n"= ; > exit ($exit_code); > } > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > ... > But running the packaged version - I get varied results. The sample code always returns 0 for $? But my bigger piece of code provides proper code for 0 or 2, but a 0 when exiting with a 1. > [dkhosla]$ ./t 2 > called with ./t 2 > Exiting final with exit_status 2, ? =3D 2 > [dkhosla]$ echo $? > 0 It's a bug in PAR::Packer =F0=9F=99=81 Please try with HEAD from https://github.com/rschupp/PAR-Packer Cheers, Roderich --000000000000b894070600ac4907 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">On Mon, Jul 17, 2023 at 7:56=E2=80=AFAM Deepak Khosla via = par <<a href=3D"mailto:[email protected]">[email protected]</a>> wrote:<br>>= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D<br>> use strict;<br>> use warnings;<br>> my $exit_code =3D = $ARGV[0];<br>> print "called with $0 $exit_code\n";<br>><br= >> END {<br>> =C2=A0 =C2=A0 $? =3D $exit_code; =C2=A0 =C2=A0 # =C2=A0= Setting this in case exit is ignoring our exit_code<br>> =C2=A0 =C2=A0 p= rint STDERR "Exiting final with exit_status $exit_code, ? =3D $? \n&qu= ot;;<br>> =C2=A0 =C2=A0 exit ($exit_code);<br>> }<br>> =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D<br>> ...<br>> But running the packaged version - I get vari= ed results. The sample code always returns 0 for $? But my bigger piece of = code provides proper code for 0 or 2, but a 0 when exiting with a 1.<br>>= ; [dkhosla]$ ./t 2<br>> called with ./t 2<br>> Exiting final with exi= t_status 2, ? =3D 2<br>> [dkhosla]$ echo $?<br>> 0<br><div><br></div>= <div>It's a bug in PAR::Packer =F0=9F=99=81=C2=A0</div><div>Please try = with HEAD from <a href=3D"https://github.com/rschupp/PAR-Packer">https://gi= thub.com/rschupp/PAR-Packer</a> <br></div><div><br></div><div>Cheers, Roder= ich<br></div></div> --000000000000b894070600ac4907--