mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-29 06:46:35 -04:00
client: don't log exit code when --no-wait is used, unless non-zero
When the following command is run:
footclient --no-wait sh -c 'exit 42'
...the logged message is always:
info: client.c:420: exit-code=0
...because fdm_client() just sends a phony exit code of 0, instead
of waiting for the child to exit, as would usually be the case.
Logging an incorrect exit code can be somewhat misleading. It seems
better to just log nothing, when no useful information is available.
This commit is contained in:
parent
07652d3b9e
commit
743b2f8c07
1 changed files with 2 additions and 1 deletions
3
client.c
3
client.c
|
|
@ -417,7 +417,8 @@ main(int argc, char *const *argv)
|
|||
int exit_code;
|
||||
ssize_t rcvd = recv(fd, &exit_code, sizeof(exit_code), 0);
|
||||
|
||||
LOG_INFO("exit-code=%d", exit_code);
|
||||
if (!no_wait || exit_code != 0)
|
||||
LOG_INFO("exit-code=%d", exit_code);
|
||||
|
||||
if (rcvd == -1 && errno == EINTR)
|
||||
xassert(aborted);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue