[hackers] [sent] Change an eprintf to a die to stop child from running its own slideshow || David Phillips

From: <git_AT_suckless.org>
Date: Wed, 20 Jan 2016 08:22:46 +0100 (CET)

commit 022ae4836072e3534c5ce61d063179d6bab9d73a
Author: David Phillips <dbphillipsnz_AT_gmail.com>
AuthorDate: Fri Dec 11 12:23:45 2015 +1300
Commit: Markus Teich <markus.teich_AT_stusta.mhn.de>
CommitDate: Thu Dec 24 01:57:50 2015 +0100

    Change an eprintf to a die to stop child from running its own slideshow
    
    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.

diff --git a/sent.c b/sent.c
index 99361e8..cdc637f 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("sh", "sh", "-c", cmd, (char *)0);
- eprintf("execlp sh -c '%s':", cmd);
+ die("execlp sh -c '%s':", cmd);
         }
         close(fds[1]);
         return fds[0];
Received on Wed Jan 20 2016 - 08:22:46 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 20 2016 - 08:24:20 CET