Add a "restart wm" function. ok oga@

This commit is contained in:
ian
2007-11-28 16:35:52 +00:00
parent f14a3eeebf
commit 8b3cd2243a
5 changed files with 56 additions and 3 deletions

16
util.c
View File

@@ -39,6 +39,22 @@ u_spawn(char *argstr)
return (0);
}
void
exec_wm(char *argstr)
{
char *args[MAXARGLEN], **ap = args;
char **end = &args[MAXARGLEN - 1];
while (ap < end && (*ap = strsep(&argstr, " \t")) != NULL)
ap++;
*ap = NULL;
setsid();
execvp(args[0], args);
err(1, args[0]);
}
int dirent_exists(char *filename) {
struct stat buffer;