From a7b5b10a0a32dd9a3f82c600898393fc53cfc4fc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Jun 2000 12:14:51 +0000 Subject: fixed two minor bugs in new sys_select() (This used to be commit 5afc5f503144c81ebc6139719fd88335fd30f4ad) --- source3/lib/select.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/lib/select.c') 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); -- cgit