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