summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/select.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/lib/select.c b/source3/lib/select.c
index 550941ba77..efcf63becc 100644
--- a/source3/lib/select.c
+++ b/source3/lib/select.c
@@ -1,5 +1,6 @@
/*
- Unix SMB/CIFS implementation.
+ Unix SMB/Netbios implementation.
+ Version 3.0
Samba select/poll implementation
Copyright (C) Andrew Tridgell 1992-1998
@@ -133,10 +134,12 @@ int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorf
{
int ret;
fd_set *readfds2, readfds_buf, *writefds2, writefds_buf, *errorfds2, errorfds_buf;
+ struct timeval tval2, *ptval;
readfds2 = (readfds ? &readfds_buf : NULL);
writefds2 = (writefds ? &writefds_buf : NULL);
errorfds2 = (errorfds ? &errorfds_buf : NULL);
+ ptval = (tval ? &tval2 : NULL);
do {
if (readfds)
@@ -145,7 +148,10 @@ int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorf
writefds_buf = *writefds;
if (errorfds)
errorfds_buf = *errorfds;
- ret = sys_select(maxfd, readfds2, writefds2, errorfds2, tval);
+ if (tval)
+ tval2 = *tval;
+
+ ret = sys_select(maxfd, readfds2, writefds2, errorfds2, ptval);
} while (ret == -1 && errno == EINTR);
if (readfds)