diff options
author | Jeremy Allison <jra@samba.org> | 2000-05-10 18:27:58 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-05-10 18:27:58 +0000 |
commit | a9c4371a2dc27e499ad6d35af1b598a4af0026c8 (patch) | |
tree | 75a86292a066abf130c1e33a29d0f08ce7841b93 /source | |
parent | ada483cb56453afc6df4ec4be18bfe5e943c7150 (diff) | |
download | samba-a9c4371a2dc27e499ad6d35af1b598a4af0026c8.tar.gz samba-a9c4371a2dc27e499ad6d35af1b598a4af0026c8.tar.xz samba-a9c4371a2dc27e499ad6d35af1b598a4af0026c8.zip |
Fix from David Collier-Brown - sys_select return was not being checked.
Jeremy.
Diffstat (limited to 'source')
-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 dae7cf087a1..f8f38fe44d3 100644 --- a/source/libsmb/nmblib.c +++ b/source/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)); |