mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
tools: do not change signals for memlocked daemons
This commit is contained in:
parent
d2c4ce254b
commit
075f85dcb5
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "lib.h"
|
#include "lib.h"
|
||||||
#include "lvm-signal.h"
|
#include "lvm-signal.h"
|
||||||
|
#include "memlock.h"
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
@ -60,6 +61,8 @@ void sigint_allow(void)
|
|||||||
struct sigaction handler;
|
struct sigaction handler;
|
||||||
sigset_t sigs;
|
sigset_t sigs;
|
||||||
|
|
||||||
|
if (memlock_count_daemon())
|
||||||
|
return;
|
||||||
/*
|
/*
|
||||||
* Do not overwrite the backed-up handler data -
|
* Do not overwrite the backed-up handler data -
|
||||||
* just increase nesting count.
|
* just increase nesting count.
|
||||||
@ -91,6 +94,9 @@ void sigint_allow(void)
|
|||||||
|
|
||||||
void sigint_restore(void)
|
void sigint_restore(void)
|
||||||
{
|
{
|
||||||
|
if (memlock_count_daemon())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!_handler_installed ||
|
if (!_handler_installed ||
|
||||||
--_handler_installed >= MAX_SIGINTS)
|
--_handler_installed >= MAX_SIGINTS)
|
||||||
return;
|
return;
|
||||||
@ -112,6 +118,9 @@ void block_signals(uint32_t flags __attribute__((unused)))
|
|||||||
{
|
{
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
|
|
||||||
|
if (memlock_count_daemon())
|
||||||
|
return;
|
||||||
|
|
||||||
if (_signals_blocked)
|
if (_signals_blocked)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -130,6 +139,9 @@ void block_signals(uint32_t flags __attribute__((unused)))
|
|||||||
|
|
||||||
void unblock_signals(void)
|
void unblock_signals(void)
|
||||||
{
|
{
|
||||||
|
if (memlock_count_daemon())
|
||||||
|
return;
|
||||||
|
|
||||||
/* Don't unblock signals while any locks are held */
|
/* Don't unblock signals while any locks are held */
|
||||||
if (!_signals_blocked)
|
if (!_signals_blocked)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user