summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-25 14:11:35 -0700
committerJeremy Allison <jra@samba.org>2007-10-25 14:11:35 -0700
commit38c34ffd6bcd14314330fd5f2e2a401dbf9cd061 (patch)
tree4a85b78174ef6cf51bb6c1f30d5141c942644079 /source3/smbd
parent7c6ed7aa1c95f61a4569f266e42938c6b225944e (diff)
downloadsamba-38c34ffd6bcd14314330fd5f2e2a401dbf9cd061.tar.gz
samba-38c34ffd6bcd14314330fd5f2e2a401dbf9cd061.tar.bz2
samba-38c34ffd6bcd14314330fd5f2e2a401dbf9cd061.zip
Ensure we don't terminate if we fail to bind to a socket,
only fail if we can't bind to any socket. Jeremy. (This used to be commit 2ec6224b552ef86fa1739c9e396c39c7ec6c76c6)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/server.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 0a292bc616..abad0efc3d 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -435,7 +435,7 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
s = open_socket_in(SOCK_STREAM, port, 0,
&ss, true);
if (s == -1) {
- return false;
+ continue;
}
/* ready to listen */
@@ -471,6 +471,11 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
SAFE_FREE(ports);
+ if (num_sockets == 0) {
+ DEBUG(0,("open_sockets_smbd: No "
+ "sockets available to bind to.\n"));
+ return false;
+ }
/* Setup the main smbd so that we can get messages. Note that
do this after starting listening. This is needed as when in