Skip to content
  • Michael Pyne's avatar
    util: Add resilience to check for missing programs. · b6853bea
    Michael Pyne authored
    My last commit checked for missing executables before trying to execute
    them, but still left open the possibility that it would be impossible to
    call exec(2) on an executable that had just been found (for whatever
    reason).
    
    Closer inspection in 'perldoc perlipc', and 'perldoc -f open' has helped
    illustrate how to catch that condition. E.g. it turns out that calling
    'close' on a pipe-opened filehandle will automatically call waitpid,
    plus I'd forgotten to exit in that error case in the child proc. (This
    is why it would take 2-3 seconds after failing for the parent process to
    continue).
    
    The more interesting question is what error policy to use in this case.
    Errors are expected in pretend mode (this function actually runs
    processes even during pretend mode since otherwise it can be impossible
    to determine whether to clone or update, switch branches, etc.), but on
    the other hand during execution errors should be unexpected and
    noteworthy.
    
    FIXED-IN:15.04
    BUG:345425
    b6853bea