From 2c978311dcb869b91a7787feba7f537056f4b90d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 10 May 2000 18:53:03 +0000 Subject: Ho hum - forgot timeout case. Jeremy. (This used to be commit 597ecd724e0d4ac7c19eb9fb85b3c9910bbfb114) --- source3/libsmb/nmblib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/libsmb/nmblib.c') 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)); -- cgit