summaryrefslogtreecommitdiff
path: root/source3/smbd/oplock_linux.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-06-19 21:30:27 +0000
committerJeremy Allison <jra@samba.org>2000-06-19 21:30:27 +0000
commit5e06151e4d13f6c57559e73dcc88e03ec47c63a0 (patch)
tree3ca7711b4aa55032e632a3c3a2a70c6afdd4c54e /source3/smbd/oplock_linux.c
parentc89f1ae0cf5856c30172c11fb935ee68f15f8be7 (diff)
downloadsamba-5e06151e4d13f6c57559e73dcc88e03ec47c63a0.tar.gz
samba-5e06151e4d13f6c57559e73dcc88e03ec47c63a0.tar.bz2
samba-5e06151e4d13f6c57559e73dcc88e03ec47c63a0.zip
Paranoia changes to ensure that anything touched by a signal handler
and the main code is declared as VOLATILE SIG_ATOMIC_T. Jeremy. (This used to be commit b737c784e34b0e1af014cb828ef37d5b6d73c3e2)
Diffstat (limited to 'source3/smbd/oplock_linux.c')
-rw-r--r--source3/smbd/oplock_linux.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c
index c53dd1c57f..d97378ac5d 100644
--- a/source3/smbd/oplock_linux.c
+++ b/source3/smbd/oplock_linux.c
@@ -27,9 +27,9 @@
extern int DEBUGLEVEL;
-static unsigned signals_received;
-static unsigned signals_processed;
-static int fd_pending; /* the fd of the current pending signal */
+static VOLATILE SIG_ATOMIC_T signals_received;
+static VOLATILE SIG_ATOMIC_T signals_processed;
+static VOLATILE SIG_ATOMIC_T fd_pending; /* the fd of the current pending signal */
#ifndef F_SETLEASE
#define F_SETLEASE 1024
@@ -57,7 +57,7 @@ handle a LEASE signal, incrementing the signals_received and blocking the signal
static void signal_handler(int signal, siginfo_t *info, void *unused)
{
BlockSignals(True, signal);
- fd_pending = info->si_fd;
+ fd_pending = (SIG_ATOMIC_T)info->si_fd;
signals_received++;
sys_select_signal();
}
@@ -133,8 +133,8 @@ static BOOL linux_oplock_receive_message(fd_set *fds, char *buffer, int buffer_l
if (signals_received == signals_processed) return False;
- if (sys_fstat(fd_pending,&sbuf) == -1) {
- DEBUG(0,("Invalid file descriptor %d in kernel oplock break!\n", fd_pending));
+ if (sys_fstat((int)fd_pending,&sbuf) == -1) {
+ DEBUG(0,("Invalid file descriptor %d in kernel oplock break!\n", (int)fd_pending));
ret = False;
goto out;
}
@@ -162,7 +162,7 @@ dev = %x, inode = %.0f\n", (unsigned int)dev, (double)inode ));
out:
/* now we can receive more signals */
- fd_pending = -1;
+ fd_pending = (SIG_ATOMIC_T)-1;
signals_processed++;
BlockSignals(False, RT_SIGNAL_LEASE);