diff --git a/wiz.c b/wiz.c index 4dab49b..b2ac72e 100644 --- a/wiz.c +++ b/wiz.c @@ -21,8 +21,6 @@ static struct wl_seat *seat; static const struct ext_idle_notification_v1_listener idlelistener; static const struct wl_registry_listener reglistener; -pid_t cpid; - struct Events { uint32_t delay; /* in ms */ char **idlecmd; @@ -94,6 +92,8 @@ static const struct ext_idle_notification_v1_listener idlelistener = { static void run(char **cmd) { + static pid_t cpid; + waitpid(-1, NULL, WNOHANG); if (killchild && cpid) kill(cpid, SIGINT);