bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 5.005_03, BeOS: incorrect $? after system invocation (Was: 2.53b on


From: Akim Demaille
Subject: Re: 5.005_03, BeOS: incorrect $? after system invocation (Was: 2.53b on BeOS, 7 failures)
Date: 29 Jul 2002 13:12:50 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

| > This part will be the most painful one to debug.  First of all, what
| > perl --version?
| 
| Perl verison is 5.005_03
| 
| > As a matter of fact, I would like to have these too:
| >
| >       perl -e 'system ("false"); print STDERR "$?\n";'
| >
| > (should say 256), and
| 
| Your additional request:
| 
| 505 >perl -e 'system ("false"); print STDERR "$?\n";'
| 1

Ouch!!!  That's the culprit.


| >
| >        ../../autom4te -l m4sugar -Wall,error script.4s -f -v
| >
| > (note that I added -v).
| 
| 506 >../../autom4te -l m4sugar -Wall,error script.4s -f -v
| [...]
| autom4te: /boot/apps/GeekGadgets/bin/m4 --nesting-limit=1024: failed
| with exit status: 0

Same thing: instead of 256, we have 1, so exit status = 0.

| General.pm: END: received: ?: 0, es: 0
| General.pm: END: invoking _exit (0)
| 507 /boot/home/develop/autoconf-2.53b/tests/testsuite.dir/012>




Thanks, this says it all: under BeOS, system doesn't seem to return
the proper $?.  It should be easy to add a special case using $^O eq
'beos' (btw, could you run 

        perl -e print "$^O\n";'

just to make sure it does return `beos': it is not documented in
perlport), but I'd like to know if anyone at Perl's know about this
issue and the recommended workaround.  I couldn't find any relevant
information, including from man perlport which just says:

       system LIST
               Only implemented if ToolServer is installed.
               (Mac OS)

               As an optimization, may not call the command shell
               specified in $ENV{PERL5SHELL}.  "system(1, @args)"
               spawns an external process and immediately returns its
               process designator, without waiting for it to
               terminate.  Return value may be used subsequently in
               "wait" or "waitpid".  Failure to spawn() a sub­ process
               is indicated by setting $? to "255 << 8".  $? is set in
               a way compatible with Unix (i.e. the exitstatus of the
               subprocess is obtained by "$? >> 8", as described in
               the documentation).  (Win32)

               There is no shell to process metacharacters, and the
               native standard is to pass a command line ter­ minated
               by "\n" "\r" or "\0" to the spawned pro­ gram.
               Redirection such as "> foo" is performed (if at all) by
               the run time library of the spawned program.  "system"
               list will call the Unix emula­ tion library's "exec"
               emulation, which attempts to provide emulation of the
               stdin, stdout, stderr in force in the parent, providing
               the child program uses a compatible version of the
               emulation library.  scalar will call the native command
               line direct and no such emulation of a child Unix pro­
               gram will exists.  Mileage will vary.  (RISC OS)

               Far from being POSIX compliant.  Because there may be
               no underlying /bin/sh tries to work around the problem
               by forking and execing the first token in its argument
               string.  Handles basic redirection ("<" or ">") on its
               own behalf. (MiNT)

               Does not automatically flush output handles on some
               platforms.  (SunOS, Solaris, HP-UX)

As you can see, there is nothing specific about this issue.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]