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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 } | 628 } |
629 | 629 |
630 | 630 |
631 intptr_t Process::CurrentProcessId() { | 631 intptr_t Process::CurrentProcessId() { |
632 return static_cast<intptr_t>(getpid()); | 632 return static_cast<intptr_t>(getpid()); |
633 } | 633 } |
634 | 634 |
635 | 635 |
636 static Mutex* signal_mutex = new Mutex(); | 636 static Mutex* signal_mutex = new Mutex(); |
637 static SignalInfo* signal_handlers = NULL; | 637 static SignalInfo* signal_handlers = NULL; |
638 static const int kSignalsCount = 5; | 638 static const int kSignalsCount = 6; |
639 static const int kSignals[kSignalsCount] = { | 639 static const int kSignals[kSignalsCount] = { |
| 640 SIGHUP, |
640 SIGINT, | 641 SIGINT, |
641 SIGWINCH, | |
642 SIGTERM, | 642 SIGTERM, |
643 SIGUSR1, | 643 SIGUSR1, |
644 SIGUSR2 | 644 SIGUSR2, |
| 645 SIGWINCH |
645 }; | 646 }; |
646 | 647 |
647 | 648 |
648 SignalInfo::~SignalInfo() { | 649 SignalInfo::~SignalInfo() { |
649 VOID_TEMP_FAILURE_RETRY(close(fd_)); | 650 VOID_TEMP_FAILURE_RETRY(close(fd_)); |
650 } | 651 } |
651 | 652 |
652 | 653 |
653 static void SignalHandler(int signal) { | 654 static void SignalHandler(int signal) { |
654 MutexLocker lock(signal_mutex); | 655 MutexLocker lock(signal_mutex); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 bzero(&act, sizeof(act)); | 743 bzero(&act, sizeof(act)); |
743 act.sa_handler = SIG_DFL; | 744 act.sa_handler = SIG_DFL; |
744 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL)); | 745 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL)); |
745 } | 746 } |
746 } | 747 } |
747 | 748 |
748 } // namespace bin | 749 } // namespace bin |
749 } // namespace dart | 750 } // namespace dart |
750 | 751 |
751 #endif // defined(TARGET_OS_ANDROID) | 752 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |