From f04ce61b8056b79ce2dcf9fc6bb7c35ccfee10eb Mon Sep 17 00:00:00 2001 From: Benoit Dejean Date: Sat, 28 Feb 2015 04:08:18 +0100 Subject: [PATCH] Run server_command instead of hardcoded LIBGTOP_SERVER. --- lib/init.c | 2 +- lib/open.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/init.c b/lib/init.c index 36014f64..6ad2ee4f 100644 --- a/lib/init.c +++ b/lib/init.c @@ -141,7 +141,7 @@ _init_server (glibtop *server, const unsigned features) /* Open pipe to server. */ server->method = GLIBTOP_METHOD_PIPE; - + server->server_command = g_strdup(LIBGTOP_SERVER); } else { glibtop_error_r (server, "Unknown server method '%s'", diff --git a/lib/open.c b/lib/open.c index a3d4fdd6..a63025fa 100644 --- a/lib/open.c +++ b/lib/open.c @@ -95,7 +95,7 @@ glibtop_open_l (glibtop *server, const char *program_name, case GLIBTOP_METHOD_PIPE: #ifdef LIBGTOP_ENABLE_DEBUG fprintf (stderr, "Opening pipe to server (%s).\n", - LIBGTOP_SERVER); + server->server_command); #endif if (pipe (server->input) || pipe (server->output)) @@ -110,9 +110,9 @@ glibtop_open_l (glibtop *server, const char *program_name, close (server->input [0]); close (server->output [1]); dup2 (server->input [1], 1); dup2 (server->output [0], 0); - execl (LIBGTOP_SERVER, "libgtop-server", NULL); + execl (server->server_command, "libgtop-server", NULL); glibtop_error_io_r (server, "execl (%s)", - LIBGTOP_SERVER); + server->server_command); _exit (2); }