Re: [PATCH v6 3/5] difftool: avoid returning -1 to cmd_main() from run_dir_diff()

From
Junio C Hamano <hidden>
Date
2021-10-01 00:12:27
David Aguilar [off-list ref] writes:
quoted
Among them, the return value from run_command_v_opt() eventually
come from wait_or_whine(), I think, so it may be generic -1 or
it may be WEXITSTATUS() of the child process.

But I am not sure if this particular caller cares.  It is not
The property I was trying to maintain is that we would forward the result
from the child process in most situations, so we should try and forward
the result from run_command_v_opt() whenever possible.
Oh, if it were the case, then I agree that !!ret would not be
sufficient.

I just had an impression that this particular caller of the
run_command_v_opt() did not care, as it did not special case -1
returned from the function as different from what came from
WEXITSTATUS().
That suggests that Ævar's sug is better...

    return (ret < 0) ? 1 : ret;
Yup, that would work, as long as exit status 1 from the external
diff tool is not all that special (in which case, we cannot tell
it from 1 that came from ret = error()).

Thanks.
Thread (1 message) 1 message, 1 author, last reply 2021-10-01
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help