Opened 9 years ago

Last modified 5 years ago

#594 new bug script exit status

Reported by: goodell Owned by:
Priority: minor Milestone: future
Component: mpich Keywords:

Description (last modified by balaji)

The run_cmd subroutine of the maint/ script uses tee to append the output to a file with the option of still sending it to standard out. The problem with this is that if the command you are running exits with non-zero status then you will lose that status because the exit code of tee will be used instead.

The most portable fix for this is to handle the fork/exec process ourselves and do tee's work of dup'ing the file descriptors as needed so that we can capture the exit status of the first element in the pipeline.

Change History (4)

comment:1 Changed 9 years ago by balaji

I don't think a fork/exec is needed here. In sh, you can do some voodoo as described here: Something similar should be possible in perl as well.

comment:2 Changed 9 years ago by goodell

Either way. I think that the fork/exec is actually more readable and easier to debug if we mess it up somehow, but you can use the file descriptor redirection tricks if you prefer. They ought to work too.

comment:3 Changed 9 years ago by balaji

  • Milestone changed from mpich2-1.1 to future
  • Owner set to balaji

Since this is not critical for the release, I'm moving it to later.

comment:4 Changed 5 years ago by balaji

  • Description modified (diff)
  • Owner balaji deleted
Note: See TracTickets for help on using tickets.