diff options
author | ian | 2007-11-28 16:35:52 +0000 |
---|---|---|
committer | ian | 2007-11-28 16:35:52 +0000 |
commit | 39193ce4f0d99ad8f16707e00590cb0831c3b2ea (patch) | |
tree | 539855d794aea6a6c341d16825df3c4be2d2d8cf /util.c | |
parent | 7f9f575b0ac9765c51c4ac7f61c23660576a5e22 (diff) | |
download | cwm-39193ce4f0d99ad8f16707e00590cb0831c3b2ea.tar.gz |
Add a "restart wm" function. ok oga@
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -4,7 +4,7 @@ * Copyright (c) 2004 Marius Aamodt Eriksen <marius@monkey.org> * All rights reserved. * - * $Id: util.c,v 1.1.1.1 2007/04/27 17:58:48 bernd Exp $ + * $Id: util.c,v 1.2 2007/11/28 16:35:52 ian Exp $ */ #include "headers.h" @@ -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; |