obmc-console: Expose socket ID configuration for client and server
* Add a new option in the server configuration file to use a friendly ID
in the socket abstract path
* Add a new command-line option to the client to connect to a particular
server socket path.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I95440ca7c2c76d2c1ef00d92abc9e0ffc32cbf5a
diff --git a/socket-handler.c b/socket-handler.c
index 00044f4..a11ab24 100644
--- a/socket-handler.c
+++ b/socket-handler.c
@@ -302,7 +302,7 @@
}
static int socket_init(struct handler *handler, struct console *console,
- struct config *config __attribute__((unused)))
+ struct config *config)
{
struct socket_handler *sh = to_socket_handler(handler);
struct sockaddr_un addr;
@@ -322,7 +322,7 @@
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
- len = console_socket_path(&addr, NULL);
+ len = console_socket_path(&addr, config_get_value(config, "socket-id"));
if (len < 0) {
if (errno)
warn("Failed to configure socket: %s", strerror(errno));