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 | 597ecd724e0d4ac7c19eb9fb85b3c9910bbfb114 (patch) | |
tree | 0e3e5b7288dd2b91381c3dca02bf04fbf08bc58d /source/libsmb/nmblib.c | |
parent | a9c4371a2dc27e499ad6d35af1b598a4af0026c8 (diff) | |
download | samba-597ecd724e0d4ac7c19eb9fb85b3c9910bbfb114.tar.gz samba-597ecd724e0d4ac7c19eb9fb85b3c9910bbfb114.tar.xz samba-597ecd724e0d4ac7c19eb9fb85b3c9910bbfb114.zip |
Ho hum - forgot timeout case.
Jeremy.
Diffstat (limited to 'source/libsmb/nmblib.c')
-rw-r--r-- | source/libsmb/nmblib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/libsmb/nmblib.c b/source/libsmb/nmblib.c index f8f38fe44d3..d4955fa6a62 100644 --- a/source/libsmb/nmblib.c +++ b/source/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)); |