in reply to Re: system() Creating Different Results than Commandline Operation.
in thread system() Creating Different Results than Commandline Operation.

due to major changes to gcov over versions it needs to be opened to see what version is installed. the code makes a call to:
if (system_no_output(3, $gcov_tool, "--help") == -1)
using your solution to rewrite system_no_output seems to hang waiting for gcov to return. I don't understand why.
  • Comment on Re^2: system() Creating Different Results than Commandline Operation.
  • Download Code

Replies are listed 'Best First'.
Re^3: system() Creating Different Results than Commandline Operation.
by ikegami (Patriarch) on Apr 06, 2009 at 18:12 UTC

    -1 is not a valid value for $?, so it's a bug to expect system_no_output to return -1.

    If you want -1 when system fails and $? otherwise, you want:

    # Your version $result = system(@_);
    # My version my $pid = open3($chld_in, $chld_out, $chld_err, @_) or return -1;

    your solution to rewrite system_no_output seems to hang waiting for gcov to return

    system waits for the child to return, so I did the same.