diff options
author | Jeremy Allison <jra@samba.org> | 2006-05-18 19:49:44 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:17:08 -0500 |
commit | 0648638fef56a65f9389c8a98f66c57663e8c401 (patch) | |
tree | 236a1c2aeb0fa8fe2d4b3913e62c222c96124130 /source3/lib | |
parent | c60e96c392df858dd22d39d27513486c5c18c3d2 (diff) | |
download | samba-0648638fef56a65f9389c8a98f66c57663e8c401.tar.gz samba-0648638fef56a65f9389c8a98f66c57663e8c401.tar.bz2 samba-0648638fef56a65f9389c8a98f66c57663e8c401.zip |
r15700: Make nmbd udp sockets non-blocking to prevent problem
with select returning true but no data being available.
Fix for bug #3779.
Jeremy.
(This used to be commit e5787cf75b2e7d50f551f34f28d280c27b0aa134)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_sock.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index de90b29294..1a73a310b6 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -278,7 +278,12 @@ ssize_t read_udp_socket(int fd,char *buf,size_t len) memset((char *)&lastip,'\0',sizeof(lastip)); ret = (ssize_t)sys_recvfrom(fd,buf,len,0,(struct sockaddr *)&sock,&socklen); if (ret <= 0) { - DEBUG(2,("read socket failed. ERRNO=%s\n",strerror(errno))); + /* Don't print a low debug error for a non-blocking socket. */ + if (errno == EAGAIN) { + DEBUG(10,("read socket returned EAGAIN. ERRNO=%s\n",strerror(errno))); + } else { + DEBUG(2,("read socket failed. ERRNO=%s\n",strerror(errno))); + } return(0); } |