Run server_command instead of hardcoded LIBGTOP_SERVER.
This commit is contained in:
committed by
Robert Roth
parent
c7f7e5a1c6
commit
f04ce61b80
@@ -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'",
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user