Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
59dc46c98f
|
|||
e900a948c8
|
|||
1c52faa753
|
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
|||||||
PKG_CONFIG = pkg-config
|
PKG_CONFIG = pkg-config
|
||||||
VERSION = 1.0
|
VERSION = 1.1
|
||||||
|
|
||||||
# flags and incs
|
# flags and incs
|
||||||
PKGS = wayland-client wayland-server
|
PKGS = wayland-client wayland-server
|
||||||
|
10
wiz.c
10
wiz.c
@ -21,8 +21,6 @@ static struct wl_seat *seat;
|
|||||||
static const struct ext_idle_notification_v1_listener idlelistener;
|
static const struct ext_idle_notification_v1_listener idlelistener;
|
||||||
static const struct wl_registry_listener reglistener;
|
static const struct wl_registry_listener reglistener;
|
||||||
|
|
||||||
pid_t cpid;
|
|
||||||
|
|
||||||
struct Events {
|
struct Events {
|
||||||
uint32_t delay; /* in ms */
|
uint32_t delay; /* in ms */
|
||||||
char **idlecmd;
|
char **idlecmd;
|
||||||
@ -94,12 +92,16 @@ static const struct ext_idle_notification_v1_listener idlelistener = {
|
|||||||
static void
|
static void
|
||||||
run(char **cmd)
|
run(char **cmd)
|
||||||
{
|
{
|
||||||
|
static pid_t cpid;
|
||||||
|
|
||||||
waitpid(-1, NULL, WNOHANG);
|
waitpid(-1, NULL, WNOHANG);
|
||||||
if (killchild && cpid)
|
if (killchild && cpid)
|
||||||
kill(cpid, SIGINT);
|
kill(cpid, SIGINT);
|
||||||
if (cmd && (cpid = fork()) == 0) {
|
if (cmd && (cpid = fork()) == 0) {
|
||||||
dup2(STDERR_FILENO, STDOUT_FILENO);
|
if (dup2(STDERR_FILENO, STDOUT_FILENO) == -1)
|
||||||
setsid();
|
die("dup2 failed:");
|
||||||
|
if (setsid() == -1)
|
||||||
|
die("setsid failed:");
|
||||||
execvp(cmd[0], cmd);
|
execvp(cmd[0], cmd);
|
||||||
die("execvp failed:");
|
die("execvp failed:");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user