diff options
author | jirka-h <hladky.jiri@gmail.com> | 2018-08-11 00:37:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-11 00:37:04 +0200 |
commit | aeb7711937bc9275f06f6d774fee8286be76cdda (patch) | |
tree | 431a430fe1817d777b51ba06984a4dc8e9d844d7 | |
parent | Bumped version to 1.9.3 (diff) | |
parent | Avoid misleading message if cmd socket is in use (diff) | |
download | haveged-aeb7711937bc9275f06f6d774fee8286be76cdda.tar.xz haveged-aeb7711937bc9275f06f6d774fee8286be76cdda.zip |
Merge pull request #4 from bitstreamout/initrd
Avoid misleading message if cmd socket is in use
-rw-r--r-- | src/haveged.c | 7 |
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) |