From ea3954427e3e3453eba49e302bf4e3a0272b172e Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 16 Sep 2015 17:58:25 +0000 Subject: 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. --- kbfunc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'kbfunc.c') 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 @@ -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!"); -- cgit v1.2.3-2-gb3c3