diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-11-17 01:05:50 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-11-17 01:05:50 +0000 |
commit | 9770a813630d41b549068c8da54e0c050f8da64e (patch) | |
tree | e94b9f9f95a5c51a38d35da62189dd814eeb1466 /source3/lib | |
parent | 29e6b9cdd089eccc6ed0877d8bad8eb193e339e1 (diff) | |
download | samba-9770a813630d41b549068c8da54e0c050f8da64e.tar.gz samba-9770a813630d41b549068c8da54e0c050f8da64e.tar.bz2 samba-9770a813630d41b549068c8da54e0c050f8da64e.zip |
save and restore errno in select
(This used to be commit 34f0379096d0701c74a51c51649ffe4cb1a24291)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/select.c | 6 |
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; } |