From 21748fee311831e06da6f724d418e1b9dd94c1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 30 Sep 2019 11:21:23 +0200 Subject: Simplify spawn to use more approproate GLib function --- surf.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/surf.c b/surf.c index 8a1f3d7..39c2b5f 100644 --- a/surf.c +++ b/surf.c @@ -1037,17 +1037,7 @@ newwindow(Client *c, const Arg *a, int noembed) void spawn(Client *c, const Arg *a) { - if (fork() == 0) { - if (dpy) - close(ConnectionNumber(dpy)); - close(pipein[0]); - close(pipeout[1]); - setsid(); - execvp(((char **)a->v)[0], (char **)a->v); - fprintf(stderr, "%s: execvp %s", argv0, ((char **)a->v)[0]); - perror(" failed"); - exit(1); - } + g_spawn_async(NULL, (const gchar* const *)a->v, NULL, G_SPAWN_DEFAULT, NULL, NULL, NULL, NULL); } void -- cgit v1.2.3