Handle execv() errors
Previously, awesome would just crash when execv() fails, because it already destroyed all of its internal state, but then tries to do another main loop iteration. Whoops. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
36329f9fa6
commit
05a8ef2ed9
|
@ -25,6 +25,7 @@
|
|||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "common/util.h"
|
||||
|
||||
|
@ -121,6 +122,7 @@ a_exec(const char *cmd)
|
|||
shell = "/bin/sh";
|
||||
|
||||
execl(shell, shell, "-c", cmd, NULL);
|
||||
fatal("execv() failed: %s", strerror(errno));
|
||||
}
|
||||
|
||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
|
|
Loading…
Reference in New Issue