console-server: Add --console-id option

Allow specification of the console-id on the command-line. Specification
on the command line takes precedence over the value in the configuration
file.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ia143e997b9f5386493564aa92e44e2813173e238
diff --git a/socket-handler.c b/socket-handler.c
index 16aed33..a0ec53e 100644
--- a/socket-handler.c
+++ b/socket-handler.c
@@ -342,7 +342,7 @@
 }
 
 static int socket_init(struct handler *handler, struct console *console,
-		       struct config *config)
+		       struct config *config __attribute__((unused)))
 {
 	struct socket_handler *sh = to_socket_handler(handler);
 	struct sockaddr_un addr;
@@ -356,8 +356,7 @@
 
 	memset(&addr, 0, sizeof(addr));
 	addr.sun_family = AF_UNIX;
-	len = console_socket_path(addr.sun_path,
-				  config_get_value(config, "console-id"));
+	len = console_socket_path(addr.sun_path, console->console_id);
 	if (len < 0) {
 		if (errno) {
 			warn("Failed to configure socket: %s", strerror(errno));