diff options
author | Jeremy Allison <jra@samba.org> | 2000-05-10 18:53:03 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-05-10 18:53:03 +0000 |
commit | 2c978311dcb869b91a7787feba7f537056f4b90d (patch) | |
tree | 0b3faa8e2a22a2971743a5ba012d05b80ea027e5 | |
parent | 5dfa33bf715d850bfd0530c6ff3d0496195126a1 (diff) | |
download | samba-2c978311dcb869b91a7787feba7f537056f4b90d.tar.gz samba-2c978311dcb869b91a7787feba7f537056f4b90d.tar.bz2 samba-2c978311dcb869b91a7787feba7f537056f4b90d.zip |
Ho hum - forgot timeout case.
Jeremy.
(This used to be commit 597ecd724e0d4ac7c19eb9fb85b3c9910bbfb114)
-rw-r--r-- | source3/libsmb/nmblib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c index f8f38fe44d..d4955fa6a6 100644 --- a/source3/libsmb/nmblib.c +++ b/source3/libsmb/nmblib.c @@ -960,18 +960,22 @@ struct packet_struct *receive_packet(int fd,enum packet_type type,int t) { fd_set fds; struct timeval timeout; + int ret; FD_ZERO(&fds); FD_SET(fd,&fds); timeout.tv_sec = t/1000; timeout.tv_usec = 1000*(t%1000); - if (sys_select(fd+1,&fds,&timeout) == -1) { + if ((ret = sys_select(fd+1,&fds,&timeout)) == -1) { /* errno should be EBADF or EINVAL. */ DEBUG(0,("select returned -1, errno = %s (%d)\n", strerror(errno), errno)); return NULL; } + if (ret == 0) /* timeout */ + return NULL; + if (FD_ISSET(fd,&fds)) return(read_packet(fd,type)); |