From: Jonathan McDowell Date: Fri, 6 Sep 2019 17:56:51 +0000 (+0100) Subject: Error out if there's any problem setting up the keyd socket X-Git-Tag: onak-0.6.0~12 X-Git-Url: https://the.earth.li/gitweb/?p=onak.git;a=commitdiff_plain;h=6565bed3065d1751abf469da1a85884d9ddde759 Error out if there's any problem setting up the keyd socket Rather than ending up in an accept() loop that goes nowhere, print the error we saw and exit. --- diff --git a/keydb/keyd.c b/keydb/keyd.c index ddd1366..0df7192 100644 --- a/keydb/keyd.c +++ b/keydb/keyd.c @@ -232,10 +232,15 @@ static int sock_init(const char *sockname) if (ret != -1) { ret = listen(fd, 5); - if (ret == -1) { - close(fd); - fd = -1; - } + } + + if (ret == -1) { + logthing(LOGTHING_ERROR, + "Couldn't open socket to listen on: %s (%d)", + strerror(errno), + errno); + close(fd); + fd = -1; } #ifdef HAVE_SYSTEMD }