diff options
author | Jeremy Allison <jra@samba.org> | 2006-02-14 23:00:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:10:07 -0500 |
commit | 006cf9c3654e7f18e01b75a5fe87798df862d26a (patch) | |
tree | 1e6f44379cccce99f00b258d592099ab7b650936 /source/smbd/oplock_irix.c | |
parent | a28bc614a0eb8409a98b254b32ad17c50c2eec0e (diff) | |
download | samba-006cf9c3654e7f18e01b75a5fe87798df862d26a.tar.gz samba-006cf9c3654e7f18e01b75a5fe87798df862d26a.tar.xz samba-006cf9c3654e7f18e01b75a5fe87798df862d26a.zip |
r13498: Fix the kernel oplocks code for IRIX. Should fix #3515.
Jeremy.
Diffstat (limited to 'source/smbd/oplock_irix.c')
-rw-r--r-- | source/smbd/oplock_irix.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/source/smbd/oplock_irix.c b/source/smbd/oplock_irix.c index 2224f9a6682..29bbb0f2cac 100644 --- a/source/smbd/oplock_irix.c +++ b/source/smbd/oplock_irix.c @@ -93,6 +93,9 @@ static files_struct *irix_oplock_receive_message(fd_set *fds) char dummy; files_struct *fsp; + /* Ensure we only get one call per select fd set. */ + FD_CLR(fds, oplock_pipe_read); + /* * Read one byte of zero to clear the * kernel break notify message. @@ -204,14 +207,36 @@ oplock state of %x.\n", fsp->fsp_name, (unsigned int)fsp->dev, /**************************************************************************** Set *maxfd to include oplock read pipe. + Note that fds MAY BE NULL ! If so we must do our own select. ****************************************************************************/ static BOOL irix_oplock_msg_waiting(fd_set *fds) { + int maxfd, selrtn; + fd_set myfds; + struct timeval to; + if (oplock_pipe_read == -1) return False; - return FD_ISSET(oplock_pipe_read,fds); + if (fds) { + return FD_ISSET(oplock_pipe_read,fds); + } + + FD_ZERO(&myfds); + maxfd = setup_oplock_select_set(&myfds); + /* Only do the select if we have something to select *on*. */ + if (maxfd == 0) { + return False; + } + + /* Do a zero-time select. We just need to find out if there + * are any outstanding messages. We use sys_select_intr as + * we need to ignore any signals. */ + + to = timeval_set(0, 0); + selrtn = sys_select_intr(maxfd+1,&myfds,NULL,NULL,&to); + return (selrtn == 1) ? True : False; } /**************************************************************************** |