| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 #if defined(FLETCH_TARGET_OS_LINUX) | 5 #if defined(DARTINO_TARGET_OS_LINUX) |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 #include <unistd.h> | 8 #include <unistd.h> |
| 9 #include <sys/signalfd.h> | 9 #include <sys/signalfd.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| 11 #include <sys/wait.h> | 11 #include <sys/wait.h> |
| 12 #include <errno.h> | 12 #include <errno.h> |
| 13 #include <stdlib.h> | 13 #include <stdlib.h> |
| 14 | 14 |
| 15 #include "src/shared/assert.h" | 15 #include "src/shared/assert.h" |
| 16 | 16 |
| 17 #include "src/tools/driver/platform.h" | 17 #include "src/tools/driver/platform.h" |
| 18 | 18 |
| 19 namespace fletch { | 19 namespace dartino { |
| 20 | 20 |
| 21 int SignalFileDescriptor() { | 21 int SignalFileDescriptor() { |
| 22 // Temporarily limit signals to a short list of white-listed signals. | 22 // Temporarily limit signals to a short list of white-listed signals. |
| 23 const bool limit_signals = true; | 23 const bool limit_signals = true; |
| 24 | 24 |
| 25 sigset_t signal_mask; | 25 sigset_t signal_mask; |
| 26 if (sigfillset(&signal_mask) == -1) { | 26 if (sigfillset(&signal_mask) == -1) { |
| 27 FATAL1("sigfillset failed: %s", strerror(errno)); | 27 FATAL1("sigfillset failed: %s", strerror(errno)); |
| 28 } | 28 } |
| 29 | 29 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 if (sigprocmask(SIG_UNBLOCK, &signal_mask, NULL) == -1) { | 96 if (sigprocmask(SIG_UNBLOCK, &signal_mask, NULL) == -1) { |
| 97 FATAL1("sigprocmask failed: %s", strerror(errno)); | 97 FATAL1("sigprocmask failed: %s", strerror(errno)); |
| 98 } | 98 } |
| 99 raise(-exit_code); | 99 raise(-exit_code); |
| 100 } else { | 100 } else { |
| 101 exit(exit_code); | 101 exit(exit_code); |
| 102 } | 102 } |
| 103 UNREACHABLE(); | 103 UNREACHABLE(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace fletch | 106 } // namespace dartino |
| 107 | 107 |
| 108 #endif // defined(FLETCH_TARGET_OS_LINUX) | 108 #endif // defined(DARTINO_TARGET_OS_LINUX) |
| OLD | NEW |