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_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 if (handler->signal() == signal) { | 689 if (handler->signal() == signal) { |
690 listen = false; | 690 listen = false; |
691 break; | 691 break; |
692 } | 692 } |
693 handler = handler->next(); | 693 handler = handler->next(); |
694 } | 694 } |
695 if (listen) { | 695 if (listen) { |
696 struct sigaction act; | 696 struct sigaction act; |
697 bzero(&act, sizeof(act)); | 697 bzero(&act, sizeof(act)); |
698 act.sa_handler = SignalHandler; | 698 act.sa_handler = SignalHandler; |
| 699 sigemptyset(&act.sa_mask); |
| 700 for (int i = 0; i < kSignalsCount; i++) { |
| 701 sigaddset(&act.sa_mask, kSignals[i]); |
| 702 } |
699 int status = TEMP_FAILURE_RETRY_BLOCK_SIGNALS( | 703 int status = TEMP_FAILURE_RETRY_BLOCK_SIGNALS( |
700 sigaction(signal, &act, NULL)); | 704 sigaction(signal, &act, NULL)); |
701 if (status < 0) { | 705 if (status < 0) { |
702 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(close(fds[0])); | 706 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(close(fds[0])); |
703 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(close(fds[1])); | 707 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(close(fds[1])); |
704 return -1; | 708 return -1; |
705 } | 709 } |
706 } | 710 } |
707 if (signal_handlers == NULL) { | 711 if (signal_handlers == NULL) { |
708 signal_handlers = new SignalInfo(fds[1], signal); | 712 signal_handlers = new SignalInfo(fds[1], signal); |
(...skipping 29 matching lines...) Expand all Loading... |
738 bzero(&act, sizeof(act)); | 742 bzero(&act, sizeof(act)); |
739 act.sa_handler = SIG_DFL; | 743 act.sa_handler = SIG_DFL; |
740 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL)); | 744 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL)); |
741 } | 745 } |
742 } | 746 } |
743 | 747 |
744 } // namespace bin | 748 } // namespace bin |
745 } // namespace dart | 749 } // namespace dart |
746 | 750 |
747 #endif // defined(TARGET_OS_ANDROID) | 751 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |