From 978a5767ec1a3264a4576c38bcb8718cdbadf09b Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 22 Jan 2014 22:26:05 +0000 Subject: cwm_argv doesn't need to be global any longer --- calmwm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'calmwm.c') diff --git a/calmwm.c b/calmwm.c index 5e3825c..1c38b2e 100644 --- a/calmwm.c +++ b/calmwm.c @@ -35,7 +35,6 @@ #include "calmwm.h" -char **cwm_argv; Display *X_Dpy; Time Last_Event_Time = CurrentTime; Atom cwmh[CWMH_NITEMS]; @@ -52,7 +51,7 @@ volatile sig_atomic_t cwm_status; static void sigchld_cb(int); static int x_errorhandler(Display *, XErrorEvent *); static void x_init(const char *); -static void x_restart(void); +static void x_restart(char **); static void x_teardown(void); static int x_wmerrorhandler(Display *, XErrorEvent *); @@ -61,6 +60,7 @@ main(int argc, char **argv) { const char *conf_file = NULL; char *conf_path, *display_name = NULL; + char **cwm_argv; int ch; struct passwd *pw; @@ -118,7 +118,7 @@ main(int argc, char **argv) xev_process(); x_teardown(); if (cwm_status == CWM_RESTART) - x_restart(); + x_restart(cwm_argv); return (0); } @@ -147,10 +147,10 @@ x_init(const char *dpyname) } static void -x_restart(void) +x_restart(char **args) { (void)setsid(); - (void)execvp(cwm_argv[0], cwm_argv); + (void)execvp(args[0], args); } static void -- cgit 1.4.1