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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2013-09-27 16:22:55 +02:00
parent abd8246c1b
commit 381d840a82
1 changed files with 2 additions and 2 deletions

View File

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