1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Remove unused function setChildSignalMask()

(cherry picked from commit a44dcbff13)
This commit is contained in:
Eelco Dolstra 2025-09-06 16:32:19 +02:00 committed by Mergify
parent 6ac93c92c2
commit 5ca64ebe73
2 changed files with 0 additions and 29 deletions

View file

@ -42,13 +42,6 @@ extern thread_local std::function<bool()> interruptCheck;
void _interrupted(); void _interrupted();
/**
* Sets the signal mask. Like saveSignalMask() but for a signal set that doesn't
* necessarily match the current thread's mask.
* See saveSignalMask() to set the saved mask to the current mask.
*/
void setChildSignalMask(sigset_t * sigs);
/** /**
* Start a thread that handles various signals. Also block those signals * Start a thread that handles various signals. Also block those signals
* on the current thread (and thus any threads created by it). * on the current thread (and thus any threads created by it).
@ -60,8 +53,6 @@ void startSignalHandlerThread();
/** /**
* Saves the signal mask, which is the signal mask that nix will restore * Saves the signal mask, which is the signal mask that nix will restore
* before creating child processes. * before creating child processes.
* See setChildSignalMask() to set an arbitrary signal mask instead of the
* current mask.
*/ */
void saveSignalMask(); void saveSignalMask();

View file

@ -99,26 +99,6 @@ void unix::triggerInterrupt()
static sigset_t savedSignalMask; static sigset_t savedSignalMask;
static bool savedSignalMaskIsSet = false; static bool savedSignalMaskIsSet = false;
void unix::setChildSignalMask(sigset_t * sigs)
{
assert(sigs); // C style function, but think of sigs as a reference
#if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 1) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE) \
|| (defined(_POSIX_SOURCE) && _POSIX_SOURCE)
sigemptyset(&savedSignalMask);
// There's no "assign" or "copy" function, so we rely on (math) idempotence
// of the or operator: a or a = a.
sigorset(&savedSignalMask, sigs, sigs);
#else
// Without sigorset, our best bet is to assume that sigset_t is a type that
// can be assigned directly, such as is the case for a sigset_t defined as
// an integer type.
savedSignalMask = *sigs;
#endif
savedSignalMaskIsSet = true;
}
void unix::saveSignalMask() void unix::saveSignalMask()
{ {
if (sigprocmask(SIG_BLOCK, nullptr, &savedSignalMask)) if (sigprocmask(SIG_BLOCK, nullptr, &savedSignalMask))