diff --git a/awesome.c b/awesome.c index 4ea9b236..4235af19 100644 --- a/awesome.c +++ b/awesome.c @@ -59,7 +59,7 @@ awesome_t globalconf; /** argv used to run awesome */ -static char *awesome_argv; +static char **awesome_argv; /** time of last main loop wakeup */ static struct timeval last_wakeup; @@ -465,7 +465,8 @@ void awesome_restart(void) { awesome_atexit(true); - a_exec(awesome_argv); + execvp(awesome_argv[0], awesome_argv); + fatal("execv() failed: %s", strerror(errno)); } /** Function to restart awesome on some signals. @@ -513,8 +514,7 @@ main(int argc, char **argv) { char *confpath = NULL; string_array_t searchpath; - int xfd, i, opt; - ssize_t cmdlen = 1; + int xfd, opt; xdgHandle xdg; bool no_argb = false; bool run_test = false; @@ -545,17 +545,7 @@ main(int argc, char **argv) string_array_init(&searchpath); /* save argv */ - for(i = 0; i < argc; i++) - cmdlen += a_strlen(argv[i]) + 1; - - awesome_argv = p_new(char, cmdlen); - a_strcpy(awesome_argv, cmdlen, argv[0]); - - for(i = 1; i < argc; i++) - { - a_strcat(awesome_argv, cmdlen, " "); - a_strcat(awesome_argv, cmdlen, argv[i]); - } + awesome_argv = argv; /* Text won't be printed correctly otherwise */ setlocale(LC_CTYPE, "");