summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-05-10 18:27:58 +0000
committerJeremy Allison <jra@samba.org>2000-05-10 18:27:58 +0000
commit5dfa33bf715d850bfd0530c6ff3d0496195126a1 (patch)
tree419d53be49996cb61e88383628dff0a1254cc4be /source3/libsmb
parent43a3faab0831a866559ca56e70c81be582047d0b (diff)
downloadsamba-5dfa33bf715d850bfd0530c6ff3d0496195126a1.tar.gz
samba-5dfa33bf715d850bfd0530c6ff3d0496195126a1.tar.bz2
samba-5dfa33bf715d850bfd0530c6ff3d0496195126a1.zip
Fix from David Collier-Brown - sys_select return was not being checked.
Jeremy. (This used to be commit a9c4371a2dc27e499ad6d35af1b598a4af0026c8)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/nmblib.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index dae7cf087a..f8f38fe44d 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -966,7 +966,11 @@ struct packet_struct *receive_packet(int fd,enum packet_type type,int t)
timeout.tv_sec = t/1000;
timeout.tv_usec = 1000*(t%1000);
- sys_select(fd+1,&fds,&timeout);
+ if (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 (FD_ISSET(fd,&fds))
return(read_packet(fd,type));