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_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 } | 669 } |
670 | 670 |
671 | 671 |
672 intptr_t Process::CurrentProcessId() { | 672 intptr_t Process::CurrentProcessId() { |
673 return static_cast<intptr_t>(getpid()); | 673 return static_cast<intptr_t>(getpid()); |
674 } | 674 } |
675 | 675 |
676 | 676 |
677 static Mutex* signal_mutex = new Mutex(); | 677 static Mutex* signal_mutex = new Mutex(); |
678 static SignalInfo* signal_handlers = NULL; | 678 static SignalInfo* signal_handlers = NULL; |
679 static const int kSignalsCount = 5; | 679 static const int kSignalsCount = 6; |
680 static const int kSignals[kSignalsCount] = { | 680 static const int kSignals[kSignalsCount] = { |
| 681 SIGHUP, |
681 SIGINT, | 682 SIGINT, |
682 SIGWINCH, | |
683 SIGTERM, | 683 SIGTERM, |
684 SIGUSR1, | 684 SIGUSR1, |
685 SIGUSR2 | 685 SIGUSR2, |
| 686 SIGWINCH |
686 }; | 687 }; |
687 | 688 |
688 | 689 |
689 SignalInfo::~SignalInfo() { | 690 SignalInfo::~SignalInfo() { |
690 VOID_TEMP_FAILURE_RETRY(close(fd_)); | 691 VOID_TEMP_FAILURE_RETRY(close(fd_)); |
691 } | 692 } |
692 | 693 |
693 | 694 |
694 static void SignalHandler(int signal) { | 695 static void SignalHandler(int signal) { |
695 MutexLocker lock(signal_mutex); | 696 MutexLocker lock(signal_mutex); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 bzero(&act, sizeof(act)); | 788 bzero(&act, sizeof(act)); |
788 act.sa_handler = SIG_DFL; | 789 act.sa_handler = SIG_DFL; |
789 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL)); | 790 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL)); |
790 } | 791 } |
791 } | 792 } |
792 | 793 |
793 } // namespace bin | 794 } // namespace bin |
794 } // namespace dart | 795 } // namespace dart |
795 | 796 |
796 #endif // defined(TARGET_OS_MACOS) | 797 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |