summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-11-17 01:05:50 +0000
committerAndrew Tridgell <tridge@samba.org>2000-11-17 01:05:50 +0000
commit9770a813630d41b549068c8da54e0c050f8da64e (patch)
treee94b9f9f95a5c51a38d35da62189dd814eeb1466
parent29e6b9cdd089eccc6ed0877d8bad8eb193e339e1 (diff)
downloadsamba-9770a813630d41b549068c8da54e0c050f8da64e.tar.gz
samba-9770a813630d41b549068c8da54e0c050f8da64e.tar.bz2
samba-9770a813630d41b549068c8da54e0c050f8da64e.zip
save and restore errno in select
(This used to be commit 34f0379096d0701c74a51c51649ffe4cb1a24291)
-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;
}