From: Mobashshera Rasool Date: Thu, 4 Aug 2022 07:50:36 +0000 (-0700) Subject: lib: Add errno details to the sockopt_reuseaddr api X-Git-Tag: base_8.4~164^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7cf66a22208af9c239b26fc8d3b4cfa82eead166;p=matthieu%2Ffrr.git lib: Add errno details to the sockopt_reuseaddr api Signed-off-by: Mobashshera Rasool --- diff --git a/lib/sockunion.c b/lib/sockunion.c index eff38798cc..36ae21fdd1 100644 --- a/lib/sockunion.c +++ b/lib/sockunion.c @@ -290,8 +290,10 @@ int sockopt_reuseaddr(int sock) ret = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); if (ret < 0) { - flog_err(EC_LIB_SOCKET, - "can't set sockopt SO_REUSEADDR to socket %d", sock); + flog_err( + EC_LIB_SOCKET, + "can't set sockopt SO_REUSEADDR to socket %d errno=%d: %s", + sock, errno, safe_strerror(errno)); return -1; } return 0;