aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-04-14 10:20:24 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-04-14 10:20:24 +0000
commit699c31e686ca3e1ecea93252d589f9a0e56c6a54 (patch)
treef2e3316835923f6a570b45146ae413304e69a285
parent71b73eca6ae6e2b9480e65ee50ee4ff51981fa89 (diff)
downloadlibmicrohttpd-699c31e686ca3e1ecea93252d589f9a0e56c6a54.tar.gz
libmicrohttpd-699c31e686ca3e1ecea93252d589f9a0e56c6a54.zip
Don't create daemon if failed to make daemon control pipe non-blocking
-rw-r--r--src/microhttpd/daemon.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index bcbe6b50..fcbf445a 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -3782,7 +3782,18 @@ MHD_start_daemon_va (unsigned int flags,
3782 free (daemon); 3782 free (daemon);
3783 return NULL; 3783 return NULL;
3784 } 3784 }
3785 make_nonblocking (daemon, daemon->wpipe[0]); 3785 if (MHD_NO == make_nonblocking (daemon, daemon->wpipe[0]))
3786 {
3787#ifdef HAVE_MESSAGES
3788 MHD_DLOG (daemon,
3789 "Failed to make control pipe non-blocking: %s\n",
3790 MHD_strerror_ (errno));
3791#endif
3792 MHD_pipe_close_ (daemon->wpipe[0]);
3793 MHD_pipe_close_ (daemon->wpipe[1]);
3794 free (daemon);
3795 return NULL;
3796 }
3786 make_nonblocking (daemon, daemon->wpipe[1]); 3797 make_nonblocking (daemon, daemon->wpipe[1]);
3787 } 3798 }
3788#ifndef MHD_WINSOCK_SOCKETS 3799#ifndef MHD_WINSOCK_SOCKETS