From 1ab589f39ed0429ca08f13f093161098ac511ef1 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Mon, 5 Mar 2012 22:39:24 +0100 Subject: Use SPICE_FOREIGN_MENU_SOCKET if it's available If specified, use SPICE_FOREIGN_MENU_SOCKET environment variable over snprintf(pipe_name, PIPE_NAME_MAX_LEN, PIPE_NAME, Platform::get_process_id()); since it's impossible to guess the client pid when spice-xpi launches the client as a grand-child (via script etc). This is also more aligned with the way we handle SPICE_XPI_SOCKET location. --- client/controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/controller.cpp') diff --git a/client/controller.cpp b/client/controller.cpp index e0b7fe77..514bf68a 100644 --- a/client/controller.cpp +++ b/client/controller.cpp @@ -44,7 +44,7 @@ Controller::Controller(ControllerInterface *handler) #ifdef WIN32 snprintf(pipe_name, PIPE_NAME_MAX_LEN, PIPE_NAME, Platform::get_process_id()); #else - char *p_socket = getenv("SPICE_XPI_SOCKET"); + const char *p_socket = getenv("SPICE_XPI_SOCKET"); if (!p_socket) { LOG_ERROR("Failed to get a controller connection (SPICE_XPI_SOCKET)"); throw Exception("Failed to get a controller connection (SPICE_XPI_SOCKET)"); -- cgit