socket: Actually use the console-socket definitions
Since the console_socket variables aren't declared with 'extern' in
console-server.h, we ended up with default definitions for these. This
happened to work, but with a zero-length socket path.
This change uses the console-socket.c object as intended, to provide
proper socket paths.
Now that the char[] is an extern, we'll need to get the address of it to
get the pointer value.
Also, fix the sizeof() to take account of the trailing nul.
Found by Joel Stanley <joel@jms.id.au>.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
diff --git a/console-server.h b/console-server.h
index 0ce9e6c..1a9e813 100644
--- a/console-server.h
+++ b/console-server.h
@@ -72,9 +72,9 @@
void config_fini(struct config *config);
/* socket paths */
-const char *console_socket_path;
-const size_t console_socket_path_len;
-const char *console_socket_path_readable;
+extern const char *console_socket_path;
+extern const size_t console_socket_path_len;
+extern const char *console_socket_path_readable;
/* utils */
int write_buf_to_fd(int fd, const uint8_t *buf, size_t len);