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 | 34f0379096d0701c74a51c51649ffe4cb1a24291 (patch) | |
tree | 2b0a1ff43ae10f809b6a28d120dc774e12d8f452 /source/lib/select.c | |
parent | 6e18a2aa58bc485e3c803ff357acc1b7fe6d95e1 (diff) | |
download | samba-34f0379096d0701c74a51c51649ffe4cb1a24291.tar.gz samba-34f0379096d0701c74a51c51649ffe4cb1a24291.tar.xz samba-34f0379096d0701c74a51c51649ffe4cb1a24291.zip |
save and restore errno in select
Diffstat (limited to 'source/lib/select.c')
-rw-r--r-- | source/lib/select.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/lib/select.c b/source/lib/select.c index 8a3a6293869..458642f57ec 100644 --- a/source/lib/select.c +++ b/source/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; } |