diff options
author | Karel Kočí <cynerd@email.cz> | 2019-10-01 14:12:41 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2019-10-01 14:12:41 +0200 |
commit | 9df3176e0c77d5a0a83285955cf608c50a8db3d4 (patch) | |
tree | 97f483d4912dfa1ad8adf839ba44ea4793c44ef6 /surf.c | |
parent | 21748fee311831e06da6f724d418e1b9dd94c1aa (diff) | |
download | surf-2.0.9.1.tar.gz surf-2.0.9.1.tar.bz2 surf-2.0.9.1.zip |
Revert "Simplify spawn to use more approproate GLib function"v2.0.9.1
This reverts commit 21748fee311831e06da6f724d418e1b9dd94c1aa.
Diffstat (limited to 'surf.c')
-rw-r--r-- | surf.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1037,7 +1037,17 @@ newwindow(Client *c, const Arg *a, int noembed) void spawn(Client *c, const Arg *a) { - g_spawn_async(NULL, (const gchar* const *)a->v, NULL, G_SPAWN_DEFAULT, NULL, NULL, NULL, NULL); + 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); + } } void |