Skip to content
  • Ramsay Jones's avatar
    compat/mingw.[ch]: Change return type of exec functions to int · 1696d723
    Ramsay Jones authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The POSIX standard specifies a return type of int for all six exec
    functions. In addition, all exec functions return -1 on error, and
    simply do not return on success. However, the current emulation of
    the exec functions on mingw are declared with a void return type.
    
    This would cause a problem should any code attempt to call the
    exec function in a non-void context. In particular, if an exec
    function were used in a conditional it would fail to compile.
    
    In order to improve the fidelity of the emulation, we change the
    return type of the mingw_execv[p] functions to int and return -1
    on error.
    
    Signed-off-by: default avatarRamsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    1696d723