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:
Uli Schlachter 2012-07-15 00:18:44 +02:00
parent 36329f9fa6
commit 05a8ef2ed9
1 changed files with 2 additions and 0 deletions

View File

@ -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