From f05dabd76eed11b002135cbe8f11a136146e644e Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 4 Dec 2010 13:19:01 +0100 Subject: [PATCH] spawn: Create sessions for processes (FS#851) Each process spawned from awesome now gets its own session and process group. This makes sure they aren't connected to awesome in any way any more. This especially fixes some problems with signals. Signed-off-by: Uli Schlachter --- spawn.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spawn.c b/spawn.c index 62be784a..51d506a6 100644 --- a/spawn.c +++ b/spawn.c @@ -260,6 +260,12 @@ spawn_launchee_timeout(struct ev_loop *loop, ev_timer *w, int revents) p_delete(&w); } +static void +spawn_callback(gpointer user_data) +{ + setsid(); +} + /** Spawn a command. * \param command_line The command line to launch. * \param error A error pointer to fill with the possible error from @@ -277,7 +283,7 @@ spawn_command(const gchar *command_line, GError **error) return 0; retval = g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, - NULL, NULL, &pid, error); + spawn_callback, NULL, &pid, error); g_strfreev (argv); if (!retval)