diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/oplock.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 7022b76c10..781de075b6 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -84,6 +84,11 @@ BOOL receive_local_message(fd_set *fds, char *buffer, int buffer_len, int timeou struct timeval to; int selrtn; int maxfd = oplock_sock; + time_t starttime; + + again: + + starttime = time(NULL); if (koplocks && koplocks->notification_fd != -1) { FD_SET(koplocks->notification_fd, fds); @@ -100,6 +105,12 @@ BOOL receive_local_message(fd_set *fds, char *buffer, int buffer_len, int timeou if (koplocks && koplocks->msg_waiting(fds)) { return koplocks->receive_message(fds, buffer, buffer_len); } + /* Not a kernel interrupt - could be a SIGUSR1 message. We must restart. */ + /* We need to decrement the timeout here. */ + timeout -= ((time(NULL) - starttime)*1000); + if (timeout < 0) + timeout = 0; + goto again; } /* Check if error */ |