obmc-console: Consolidate handling of default socket-id
If console-id is not specified on command line or in the config file
then use the default value. ae2460d0b8e8 ("obmc-console: Provide a
default value for `console-id`.") only implemented the default value for
naming the abstract listening socket and overlooked the new DBus path
naming convention. This caused issues during dbus registration:
```
obmc-console-server: Object name: /xyz/openbmc_project/console/(null)
obmc-console-server: Failed to issue method call: Invalid argument
```
Fixes: ae2460d0b8e8 ("obmc-console: Provide a default value for `console-id`.")
Change-Id: I6d0f7b23cc085992189cd4463129a6aae590b3e7
Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/console-socket.c b/console-socket.c
index d535182..3873440 100644
--- a/console-socket.c
+++ b/console-socket.c
@@ -34,7 +34,8 @@
ssize_t rc;
if (!id) {
- id = "default";
+ errno = EINVAL;
+ return -1;
}
rc = snprintf(sun_path + 1, sizeof(socket_path_t) - 1,