aboutsummaryrefslogtreecommitdiffstats
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan2015-09-16 17:58:25 +0000
committerokan2015-09-16 17:58:25 +0000
commitea3954427e3e3453eba49e302bf4e3a0272b172e (patch)
tree6c8c6c794afa080f95f35faa5c8ba69a756d4a90 /kbfunc.c
parent7d8a5a92b3e6bba227470f31a83772cf42b00fa9 (diff)
downloadcwm-ea3954427e3e3453eba49e302bf4e3a0272b172e.tar.gz
On execwm, we should properly release resources before exec'ing into a
new window manager; so allow CWM_EXEC_WM to assign new wm to wm_argv and pass through cwm_status (now EXECWM) so that x_teardown() gets called before exec'ing the new window manager. Removes the need for a separate x_restart() now, using new wm_argv; and consolidates errno for execvp.
Diffstat (limited to 'kbfunc.c')
-rw-r--r--kbfunc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 2c2bd68..038834b 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: kbfunc.c,v 1.117 2015/08/28 12:07:28 okan Exp $
+ * $OpenBSD: kbfunc.c,v 1.118 2015/09/16 17:58:25 okan Exp $
*/
#include <sys/types.h>
@@ -325,8 +325,9 @@ kbfunc_exec(struct client_ctx *cc, union arg *arg)
u_spawn(mi->text);
break;
case CWM_EXEC_WM:
- u_exec(mi->text);
- warn("%s", mi->text);
+ cwm_status = CWM_EXECWM;
+ free(wm_argv);
+ wm_argv = xstrdup(mi->text);
break;
default:
errx(1, "kb_func: egad, cmd changed value!");