client: exit nicely for --controller with no SPICE_XPI_SOCKET (rhbz#644292)

When starting spicec with --controller, SPICE_XPI_SOCKET environment
variable must be defined so spicec and the controller can be connected.
This commit is contained in:
Uri Lublin 2011-03-01 17:58:47 +02:00 committed by Hans de Goede
parent a0996e0f70
commit eda812f0d7

View File

@ -44,6 +44,7 @@ Controller::Controller(ControllerInterface *handler)
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)");
}
strncpy(pipe_name, p_socket, sizeof(pipe_name));
#endif