From 381d840a8245c06c88656edc26ed715ad3a53c50 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 27 Sep 2013 16:22:55 +0200 Subject: [PATCH] Use $PATH when starting $SHELL If $SHELL is set to "bash", previously awesome failed to restart itself, because it could not find "bash". This commit makes awesome use execlp() instead of execl() which means that $PATH is searched if the started command does not contain a slash and this problem is fixed. $SHELL is specified in POSIX and it doesn't seem to require an absolute path name. Signed-off-by: Uli Schlachter --- common/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/util.c b/common/util.c index 9d4615eb..3c95d8e8 100644 --- a/common/util.c +++ b/common/util.c @@ -121,8 +121,8 @@ a_exec(const char *cmd) if(!shell && !(shell = getenv("SHELL"))) shell = "/bin/sh"; - execl(shell, shell, "-c", cmd, NULL); - fatal("execv() failed: %s", strerror(errno)); + execlp(shell, shell, "-c", cmd, NULL); + fatal("execlp() failed: %s", strerror(errno)); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80