From 0daab1844efe172318e68909520ec8b97a3acff9 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Fri, 11 Mar 2016 10:43:32 +0100 Subject: helper: Add execute helper Signed-off-by: Quentin Glidic --- source/dialogs/ssh.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'source/dialogs') diff --git a/source/dialogs/ssh.c b/source/dialogs/ssh.c index 96230bf8..66fdc74a 100644 --- a/source/dialogs/ssh.c +++ b/source/dialogs/ssh.c @@ -78,25 +78,10 @@ static inline int execshssh ( const char *host ) { char **args = NULL; int argsv = 0; - helper_parse_setup ( config.ssh_command, &args, &argsv, "{host}", host, NULL ); - - GError *error = NULL; - g_spawn_async ( NULL, args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error ); - - if ( error != NULL ) { - char *msg = g_strdup_printf ( "Failed to execute: 'ssh %s'\nError: '%s'", host, error->message ); - rofi_view_error_dialog ( msg, FALSE ); - g_free ( msg ); - // print error. - g_error_free ( error ); - g_strfreev ( args ); - return FALSE; - } - // Free the args list. - g_strfreev ( args ); + helper_parse_setup ( config.ssh_command, &args, &argsv, "{host}", host, NULL ); - return TRUE; + return helper_execute ( NULL, args, "ssh ", host ); } /** -- cgit v1.2.3