Re: [dev] [PATCH] Change an eprintf to a die to stop child from running its own slideshow

From: Dimitris Papastamos <sin_AT_2f30.org>
Date: Thu, 14 Jan 2016 09:44:26 +0000

On Thu, Jan 14, 2016 at 09:02:43PM +1300, David Phillips wrote:
> The child thread was created because execlp will not return if successful.
> The eprintf was placed after the call to execlp to catch any error, but the
> child continued to return a (closed) fds[0], resulting in a second slideshow
> being run by the child.
>
> This commit fixes the issue by killing the child.
> ---
> sent.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sent.c b/sent.c
> index fc5e389..88abe90 100644
> --- a/sent.c
> +++ b/sent.c
> _AT_@ -153,7 +153,7 @@ filter(int fd, const char *cmd)
> close(fds[0]);
> close(fds[1]);
> execlp(cmd, cmd, (char *)0);
> - eprintf("execlp %s:", cmd);
> + die("execlp %s:", cmd);

Good catch. eprintf() is totally misnamed here. In general eprintf()
is not expected to return but this version actually does not exit.
Received on Thu Jan 14 2016 - 10:44:26 CET

This archive was generated by hypermail 2.3.0 : Thu Jan 14 2016 - 10:48:12 CET