From 893cbb759268bb114dcb873fef9f588eaad5263c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 28 Mar 2003 01:05:32 +0000 Subject: [PATCH] it is possible for some of the real time signals to be used by glibc, which then changes SIGRTMIN. It is also possible for bash to leave some real time signals blocked at startup. This fixes both problems. (This used to be commit 8d45bf644aecb6993c2a82b86a4527b33029ed8f) --- source3/include/includes.h | 4 ++++ source3/smbd/notify_kernel.c | 5 ++++- source3/smbd/oplock_linux.c | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/source3/include/includes.h b/source3/include/includes.h index f536ea88fe5..09c64d896d5 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -891,6 +891,10 @@ struct printjob; #define SIGCLD SIGCHLD #endif +#ifndef SIGRTMIN +#define SIGRTMIN 32 +#endif + #ifndef MAP_FILE #define MAP_FILE 0 #endif diff --git a/source3/smbd/notify_kernel.c b/source3/smbd/notify_kernel.c index 8b7ff21ecb9..efe93de5afb 100644 --- a/source3/smbd/notify_kernel.c +++ b/source3/smbd/notify_kernel.c @@ -39,7 +39,7 @@ static SIG_ATOMIC_T signals_received; #ifndef RT_SIGNAL_NOTIFY -#define RT_SIGNAL_NOTIFY 34 +#define RT_SIGNAL_NOTIFY (SIGRTMIN+2) #endif #ifndef F_SETSIG @@ -233,6 +233,9 @@ struct cnotify_fns *kernel_notify_init(void) cnotify.remove_notify = kernel_remove_notify; cnotify.select_time = -1; + /* the signal can start off blocked due to a bug in bash */ + BlockSignals(False, RT_SIGNAL_NOTIFY); + return &cnotify; } diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c index deed0c51073..84083dffc97 100644 --- a/source3/smbd/oplock_linux.c +++ b/source3/smbd/oplock_linux.c @@ -39,7 +39,7 @@ static SIG_ATOMIC_T fd_pending_array[FD_PENDING_SIZE]; #endif #ifndef RT_SIGNAL_LEASE -#define RT_SIGNAL_LEASE 33 +#define RT_SIGNAL_LEASE (SIGRTMIN+1) #endif #ifndef F_SETSIG @@ -296,6 +296,9 @@ struct kernel_oplocks *linux_init_kernel_oplocks(void) koplocks.msg_waiting = linux_oplock_msg_waiting; koplocks.notification_fd = -1; + /* the signal can start off blocked due to a bug in bash */ + BlockSignals(False, RT_SIGNAL_LEASE); + DEBUG(3,("Linux kernel oplocks enabled\n")); return &koplocks; -- 2.11.4.GIT