summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Fink <werner@suse.de>2018-08-10 16:26:03 +0200
committerWerner Fink <werner@suse.de>2018-08-10 16:40:47 +0200
commit837fec052122d7e059f53bd2f2a05bedcfe41858 (patch)
treee6960e09e5be89fcf1fe64b5bb1eebab4b56dd1b
parentImplement a command mode and use it for chroot (diff)
downloadhaveged-837fec052122d7e059f53bd2f2a05bedcfe41858.tar.xz
haveged-837fec052122d7e059f53bd2f2a05bedcfe41858.zip
Avoid misleading message if cmd socket is in use
Signed-off-by: Werner Fink <werner@suse.de>
-rw-r--r--src/haveged.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/haveged.c b/src/haveged.c
index 6bd2507..9788bda 100644
--- a/src/haveged.c
+++ b/src/haveged.c
@@ -381,7 +381,12 @@ int main(int argc, char **argv)
}
else {
socket_fd = cmd_listen(params);
- fprintf(stderr, "%s: listening socket at %d\n", params->daemon, socket_fd);
+ if (socket_fd >= 0)
+ fprintf(stderr, "%s: listening socket at %d\n", params->daemon, socket_fd);
+ else if (socket_fd == -2)
+ fprintf(stderr, "%s: command socket already in use\n", params->daemon);
+ else
+ fprintf(stderr, "%s: can not initialize command socket: %m\n", params->daemon);
}
#endif
if (params->tests_config == 0)