| 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 "bin/process.h" | 5 #include "bin/process.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <poll.h> | 9 #include <poll.h> |
| 10 #include <signal.h> | 10 #include <signal.h> |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 FDUtils::SetNonBlocking(read_err[0]); | 545 FDUtils::SetNonBlocking(read_err[0]); |
| 546 *err = read_err[0]; | 546 *err = read_err[0]; |
| 547 TEMP_FAILURE_RETRY(close(read_err[1])); | 547 TEMP_FAILURE_RETRY(close(read_err[1])); |
| 548 | 548 |
| 549 *id = pid; | 549 *id = pid; |
| 550 return 0; | 550 return 0; |
| 551 } | 551 } |
| 552 | 552 |
| 553 | 553 |
| 554 bool Process::Kill(intptr_t id, int signal) { | 554 bool Process::Kill(intptr_t id, int signal) { |
| 555 int result = TEMP_FAILURE_RETRY(kill(id, signal)); | 555 return (TEMP_FAILURE_RETRY(kill(id, signal)) != -1); |
| 556 if (result == -1) { | |
| 557 return false; | |
| 558 } | |
| 559 return true; | |
| 560 } | 556 } |
| 561 | 557 |
| 562 | 558 |
| 563 void Process::TerminateExitCodeHandler() { | 559 void Process::TerminateExitCodeHandler() { |
| 564 ExitCodeHandler::TerminateExitCodeThread(); | 560 ExitCodeHandler::TerminateExitCodeThread(); |
| 565 } | 561 } |
| 566 | 562 |
| 567 | 563 |
| 568 intptr_t Process::CurrentProcessId() { | 564 intptr_t Process::CurrentProcessId() { |
| 569 return static_cast<intptr_t>(getpid()); | 565 return static_cast<intptr_t>(getpid()); |
| 570 } | 566 } |
| OLD | NEW |