Remove global scope from sigprocmask etc.

These functions may be macros on some platforms e.g. Mac OS
This commit is contained in:
Alexander Kuzmenkov 2019-12-13 16:57:55 +03:00
parent 8b754fdcde
commit 486c061d34

View File

@ -122,9 +122,9 @@ std::unique_ptr<ShellCommand> ShellCommand::executeImpl(const char * filename, c
// Reset the signal mask: it may be non-empty and will be inherited
// by the child process, which might not expect this.
sigset_t mask;
::sigemptyset(&mask);
::sigprocmask(0, nullptr, &mask);
::sigprocmask(SIG_UNBLOCK, &mask, nullptr);
sigemptyset(&mask);
sigprocmask(0, nullptr, &mask);
sigprocmask(SIG_UNBLOCK, &mask, nullptr);
execv(filename, argv);
/// If the process is running, then `execv` does not return here.