aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-05-21 15:34:29 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-05-21 15:34:29 +0200
commitd8bd0e26174f31b25d92189d640fce6f58e92ace (patch)
tree786a8b9a78e8dcaa52ce0cd752535f89be9b7a4a
parent7684aa5922b4bb1b88d8a7609d238a9d6792feca (diff)
POTD skeleton #69.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--src/log.h2
-rw-r--r--src/socket.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/log.h b/src/log.h
index d2214df..a43c93d 100644
--- a/src/log.h
+++ b/src/log.h
@@ -5,7 +5,7 @@
#include <string.h>
#include <errno.h>
-#define LOGMSG_MAXLEN 255
+#define LOGMSG_MAXLEN BUFSIZ
#define LOG_SET_FUNCS(open_cb, close_cb, fmt_cb, fmtex_cb, fmtexerr_cb) \
{ \
log_open = open_cb; log_close = close_cb; \
diff --git a/src/socket.c b/src/socket.c
index 644d49f..1af8e7c 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -123,7 +123,7 @@ int socket_accept_in(const psocket *psock, psocket *client_psock)
&client_psock->addr_len);
if (fd < 0)
return 1;
- if (socket_nonblock(psock))
+ if (socket_setopts(fd) || socket_nonblock(psock))
{
close(fd);
return 1;
@@ -154,7 +154,8 @@ int socket_connect_in(psocket *psock, struct addrinfo **results)
if (!rp)
goto finalise;
- if (socket_setopts(fd))
+ s = socket_setopts(fd);
+ if (s)
goto finalise;
psock->fd = fd;