| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 7 | 7 |
| 8 #include "bin/process.h" | 8 #include "bin/process.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 if (handler->signal() == signal) { | 688 if (handler->signal() == signal) { |
| 689 listen = false; | 689 listen = false; |
| 690 break; | 690 break; |
| 691 } | 691 } |
| 692 handler = handler->next(); | 692 handler = handler->next(); |
| 693 } | 693 } |
| 694 if (listen) { | 694 if (listen) { |
| 695 struct sigaction act; | 695 struct sigaction act; |
| 696 bzero(&act, sizeof(act)); | 696 bzero(&act, sizeof(act)); |
| 697 act.sa_handler = SignalHandler; | 697 act.sa_handler = SignalHandler; |
| 698 sigemptyset(&act.sa_mask); |
| 699 for (int i = 0; i < kSignalsCount; i++) { |
| 700 sigaddset(&act.sa_mask, kSignals[i]); |
| 701 } |
| 698 int status = TEMP_FAILURE_RETRY_BLOCK_SIGNALS( | 702 int status = TEMP_FAILURE_RETRY_BLOCK_SIGNALS( |
| 699 sigaction(signal, &act, NULL)); | 703 sigaction(signal, &act, NULL)); |
| 700 if (status < 0) { | 704 if (status < 0) { |
| 701 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(close(fds[0])); | 705 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(close(fds[0])); |
| 702 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(close(fds[1])); | 706 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(close(fds[1])); |
| 703 return -1; | 707 return -1; |
| 704 } | 708 } |
| 705 } | 709 } |
| 706 if (signal_handlers == NULL) { | 710 if (signal_handlers == NULL) { |
| 707 signal_handlers = new SignalInfo(fds[1], signal); | 711 signal_handlers = new SignalInfo(fds[1], signal); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 737 bzero(&act, sizeof(act)); | 741 bzero(&act, sizeof(act)); |
| 738 act.sa_handler = SIG_DFL; | 742 act.sa_handler = SIG_DFL; |
| 739 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL)); | 743 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL)); |
| 740 } | 744 } |
| 741 } | 745 } |
| 742 | 746 |
| 743 } // namespace bin | 747 } // namespace bin |
| 744 } // namespace dart | 748 } // namespace dart |
| 745 | 749 |
| 746 #endif // defined(TARGET_OS_LINUX) | 750 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |