From 05a8ef2ed9881c6ec5503f43d1cff38c7c815336 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 15 Jul 2012 00:18:44 +0200 Subject: [PATCH] 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 --- common/util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/util.c b/common/util.c index 3c581639..9d4615eb 100644 --- a/common/util.c +++ b/common/util.c @@ -25,6 +25,7 @@ #include #include #include +#include #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