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

Merge pull request #14044 from NixOS/mergify/bp/2.29-maintenance/pr-13929

Remove unused function setChildSignalMask() (backport #13929)
This commit is contained in:
John Ericson 2025-09-22 13:34:12 -04:00 committed by GitHub
commit 3adb146014
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 29 deletions

View file

@ -42,13 +42,6 @@ extern thread_local std::function<bool()> interruptCheck;
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
* 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
* before creating child processes.
* See setChildSignalMask() to set an arbitrary signal mask instead of the
* current mask.
*/
void saveSignalMask();

View file

@ -99,26 +99,6 @@ void unix::triggerInterrupt()
static sigset_t savedSignalMask;
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()
{
if (sigprocmask(SIG_BLOCK, nullptr, &savedSignalMask))