Chromium Code Reviews| Index: base/process/launch_posix.cc |
| diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc |
| index 3708af6bac417b49e4015fed93eb49966ed78363..1388a0e1524bef2dc57c981025b25fe7ae915dcd 100644 |
| --- a/base/process/launch_posix.cc |
| +++ b/base/process/launch_posix.cc |
| @@ -394,6 +394,14 @@ bool LaunchProcess(const std::vector<std::string>& argv, |
| if (options.environ) |
| new_environ.reset(AlterEnvironment(*options.environ, GetEnvironment())); |
| + sigset_t full_sigset; |
| + sigfillset(&full_sigset); |
| + sigset_t old_sigset; |
| + if (pthread_sigmask(SIG_BLOCK, &full_sigset, &old_sigset) != 0) { |
|
Markus (顧孟勤)
2013/08/01 01:20:54
In principle, I believe this works OK. But you are
Markus (顧孟勤)
2013/08/01 01:20:54
And now for a nitpick:
It is actually not possibl
mdempsky_google
2013/08/01 16:25:05
https://code.google.com/p/chromium/issues/detail?i
mdempsky_google
2013/08/01 16:25:05
I expect sigfillset() + pthread_sigmask() should b
|
| + DPLOG(ERROR) << "pthread_sigmask"; |
| + return false; |
| + } |
| + |
| pid_t pid; |
| #if defined(OS_LINUX) |
| if (options.clone_flags) { |
| @@ -404,6 +412,12 @@ bool LaunchProcess(const std::vector<std::string>& argv, |
| pid = fork(); |
| } |
| + if (pid != 0) { |
| + if (pthread_sigmask(SIG_SETMASK, &old_sigset, NULL) != 0) { |
| + NOTREACHED(); |
| + } |
| + } |
| + |
| if (pid < 0) { |
| DPLOG(ERROR) << "fork"; |
| return false; |
| @@ -469,6 +483,9 @@ bool LaunchProcess(const std::vector<std::string>& argv, |
| #endif // defined(OS_MACOSX) |
| ResetChildSignalHandlersToDefaults(); |
| + if (pthread_sigmask(SIG_SETMASK, &old_sigset, NULL) != 0) { |
| + NOTREACHED(); |
| + } |
| #if 0 |
| // When debugging it can be helpful to check that we really aren't making |