diff options
author | FRIGN <dev@frign.de> | 2016-08-11 21:20:07 +0200 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-08-11 23:42:09 +0200 |
commit | e8914d5d4bedb12bccf78a930b34b1564b3dbaac (patch) | |
tree | 3de69ec293421110ae48f0b0a9f1cf1e6ae825e0 /sent.c | |
parent | cd10166b5eccac1b8cf510a7c97544d1697fbd09 (diff) |
_exit() instead of exit() after failed exec
die() calls exit(), but actually at this point the program could be in a
state not allowing this. It's better to call _exit to stop the libc from
calling any handlers that might fail at this moment anyway.
Diffstat (limited to 'sent.c')
-rw-r--r-- | sent.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -150,7 +150,8 @@ filter(int fd, const char *cmd) close(fds[0]); close(fds[1]); execlp("sh", "sh", "-c", cmd, (char *)0); - die("sent: execlp sh -c '%s':", cmd); + fprintf(stderr, "sent: execlp sh -c '%s': %s\n", cmd, strerror(errno)); + _exit(1); } close(fds[1]); return fds[0]; |