summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-05-22 21:40:14 +0000
committerJeremy Allison <jra@samba.org>2002-05-22 21:40:14 +0000
commit60d29a9fefe6ef6c79052adb74e6458dd87d5877 (patch)
tree0d9c27ea97d8a82e6e1a02a5ae5870e1398d612e /source3
parent676241d7b1e7acfd9a7f6b7b087a87f96c0ade70 (diff)
downloadsamba-60d29a9fefe6ef6c79052adb74e6458dd87d5877.tar.gz
samba-60d29a9fefe6ef6c79052adb74e6458dd87d5877.tar.bz2
samba-60d29a9fefe6ef6c79052adb74e6458dd87d5877.zip
Fix for strangeness in Linux 2.0.x select return.
Jeremy. (This used to be commit 490b95a35d1e2ccd3b80db5cfcf7b9804901d36e)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/oplock.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index e01b1b3e7e..6a47791300 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -98,6 +98,20 @@ BOOL receive_local_message( char *buffer, int buffer_len, int timeout)
selrtn = sys_select(maxfd+1,&fds,NULL,NULL,&to);
if (selrtn == -1 && errno == EINTR) {
+
+ /*
+ * Linux 2.0.x seems to have a bug in that
+ * it can return -1, EINTR with a timeout of zero.
+ * Make sure we bail out here with a read timeout
+ * if we got EINTR on a timeout of 1 or less.
+ */
+
+ if (timeout <= 1) {
+ smb_read_error = READ_TIMEOUT;
+ return False;
+ }
+
+
/* could be a kernel oplock interrupt */
if (koplocks && koplocks->msg_waiting(&fds)) {
return koplocks->receive_message(&fds, buffer, buffer_len);