summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-06-21 12:14:51 +0000
committerAndrew Tridgell <tridge@samba.org>2000-06-21 12:14:51 +0000
commita7b5b10a0a32dd9a3f82c600898393fc53cfc4fc (patch)
tree570af3cb75ec21465c054315c821485a91a0a68a /source3/lib
parent159aec63ae916eb641862e4e595df8ce8c51dee8 (diff)
downloadsamba-a7b5b10a0a32dd9a3f82c600898393fc53cfc4fc.tar.gz
samba-a7b5b10a0a32dd9a3f82c600898393fc53cfc4fc.tar.bz2
samba-a7b5b10a0a32dd9a3f82c600898393fc53cfc4fc.zip
fixed two minor bugs in new sys_select()
(This used to be commit 5afc5f503144c81ebc6139719fd88335fd30f4ad)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/select.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/lib/select.c b/source3/lib/select.c
index 48bc61ab77..8a81c10df5 100644
--- a/source3/lib/select.c
+++ b/source3/lib/select.c
@@ -28,9 +28,9 @@
this means all Samba signal handlers should call sys_select_signal()
*/
-static int initialised;
+static pid_t initialised;
static int select_pipe[2];
-static VOLATILE SIG_ATOMIC_T pipe_written, pipe_read;
+static VOLATILE unsigned pipe_written, pipe_read;
/*******************************************************************
@@ -56,12 +56,12 @@ int sys_select(int maxfd, fd_set *fds,struct timeval *tval)
{
int ret;
- if (!initialised) {
- initialised = 1;
+ if (initialised != sys_getpid()) {
+ initialised = sys_getpid();
pipe(select_pipe);
}
- maxfd = MAX(select_pipe[0], maxfd);
+ maxfd = MAX(select_pipe[0]+1, maxfd);
FD_SET(select_pipe[0], fds);
errno = 0;
ret = select(maxfd,fds,NULL,NULL,tval);