diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-06-27 12:36:04 +0000 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-06-27 12:36:04 +0000 |
commit | eaaefb9705dbdefd611893cea03126281e55a4b7 (patch) | |
tree | c87af3c1d76a8e3cbd54c761f78c57da9741764c /src | |
parent | cd1f301ce34430fc96e7ac19dfd0e297949af31b (diff) | |
download | librda-eaaefb9705dbdefd611893cea03126281e55a4b7.tar.gz librda-eaaefb9705dbdefd611893cea03126281e55a4b7.tar.bz2 librda-eaaefb9705dbdefd611893cea03126281e55a4b7.zip |
src/rda_x2go.c: Use g_spawn_command_line_sync() for suspending/terminating X2Go Sessions.
Diffstat (limited to 'src')
-rw-r--r-- | src/rda_x2go.c | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/src/rda_x2go.c b/src/rda_x2go.c index 34094e3..a964fed 100644 --- a/src/rda_x2go.c +++ b/src/rda_x2go.c @@ -47,23 +47,15 @@ rda_session_suspend_x2go(void) if (!rda_session_is_x2go()) return FALSE; - gint std_in, std_out; - GError * error = NULL; + gint exit_status = 0; + gchar *std_out, *std_err; + GError *error = NULL; - const gchar * argv[1]; - argv[0] = "x2gosuspend-session"; - - // FIXME: use g_spawn_sync - g_spawn_async_with_pipes(NULL, /* pwd */ - (gchar **)argv, - NULL, /* env */ - G_SPAWN_DO_NOT_REAP_CHILD, - NULL, NULL, /* child setup */ - NULL, - &std_in, - &std_out, - NULL, /* stderr */ - &error); /* error */ + g_spawn_command_line_sync("x2gosuspend-session", + &std_out, + &std_err, + &exit_status, + &error); if (error == NULL) { @@ -81,23 +73,15 @@ rda_session_terminate_x2go(void) if (!rda_session_is_x2go()) return FALSE; - gint std_in, std_out; + gint exit_status = 0; + gchar *std_out, *std_err; GError * error = NULL; - const gchar * argv[1]; - argv[0] = "x2goterminate-session"; - - // FIXME: use g_spawn_sync - g_spawn_async_with_pipes(NULL, /* pwd */ - (gchar **)argv, - NULL, /* env */ - G_SPAWN_DO_NOT_REAP_CHILD, - NULL, NULL, /* child setup */ - NULL, - &std_in, - &std_out, - NULL, /* stderr */ - &error); /* error */ + g_spawn_command_line_sync("x2goterminate-session", + &std_out, + &std_err, + &exit_status, + &error); if (error == NULL) { |