summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2019-09-30 11:21:23 +0200
committerKarel Kočí <cynerd@email.cz>2019-09-30 11:21:23 +0200
commit21748fee311831e06da6f724d418e1b9dd94c1aa (patch)
tree960efce0a93f9e55ee86f435264ccc0d2244b4ad
parente9bbc58fe1b54567738bc2720cd0332feb9ff3e2 (diff)
downloadsurf-21748fee311831e06da6f724d418e1b9dd94c1aa.tar.gz
surf-21748fee311831e06da6f724d418e1b9dd94c1aa.tar.bz2
surf-21748fee311831e06da6f724d418e1b9dd94c1aa.zip
Simplify spawn to use more approproate GLib functionv2.0.9
-rw-r--r--surf.c12
1 files changed, 1 insertions, 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