summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/libsmb/nmblib.c6
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));