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 <psychon@znc.in>
This commit is contained in:
parent
7898cc7de7
commit
f05dabd76e
8
spawn.c
8
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)
|
||||
|
|
Loading…
Reference in New Issue