summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/select.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/lib/select.c b/source3/lib/select.c
index 8a3a629386..458642f57e 100644
--- a/source3/lib/select.c
+++ b/source3/lib/select.c
@@ -54,7 +54,7 @@ for file descriptors that were readable
********************************************************************/
int sys_select(int maxfd, fd_set *fds,struct timeval *tval)
{
- int ret;
+ int ret, saved_errno;
if (initialised != sys_getpid()) {
pipe(select_pipe);
@@ -79,11 +79,15 @@ int sys_select(int maxfd, fd_set *fds,struct timeval *tval)
}
}
+ saved_errno = errno;
+
while (pipe_written != pipe_read) {
char c;
if (read(select_pipe[0], &c, 1) == 1) pipe_read++;
}
+ errno = saved_errno;
+
return ret;
}