aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2023-11-10 10:24:55 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2023-11-10 17:38:26 +0300
commitc211e198c623f7c640fd06966dac268c5c010868 (patch)
tree1c7d692fd6e6b7bcbe35ddd3948620b877198b9c
parent696e0401466e3b0b8da467acfa9d0c25faf4527d (diff)
downloadlibmicrohttpd-c211e198c623f7c640fd06966dac268c5c010868.tar.gz
libmicrohttpd-c211e198c623f7c640fd06966dac268c5c010868.zip
MHD_start_daemon(): added stricter checks for bind() and listen() return values
-rw-r--r--src/microhttpd/daemon.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 12d687e2..f0b620d1 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -8036,7 +8036,7 @@ MHD_start_daemon_va (unsigned int flags,
8036#endif 8036#endif
8037#endif 8037#endif
8038 } 8038 }
8039 if (-1 == bind (listen_fd, servaddr, addrlen)) 8039 if (0 != bind (listen_fd, servaddr, addrlen))
8040 { 8040 {
8041#ifdef HAVE_MESSAGES 8041#ifdef HAVE_MESSAGES
8042 MHD_DLOG (daemon, 8042 MHD_DLOG (daemon,
@@ -8066,8 +8066,8 @@ MHD_start_daemon_va (unsigned int flags,
8066 } 8066 }
8067 } 8067 }
8068#endif 8068#endif
8069 if (listen (listen_fd, 8069 if (0 != listen (listen_fd,
8070 (int) daemon->listen_backlog_size) < 0) 8070 (int) daemon->listen_backlog_size))
8071 { 8071 {
8072#ifdef HAVE_MESSAGES 8072#ifdef HAVE_MESSAGES
8073 MHD_DLOG (daemon, 8073 MHD_DLOG (daemon,