Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Unified Diff: runtime/bin/process_fuchsia.cc

Issue 2596543002: Fix Process.runSync error handling. (Closed)
Patch Set: Address comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/process_android.cc ('k') | runtime/bin/process_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_fuchsia.cc
diff --git a/runtime/bin/process_fuchsia.cc b/runtime/bin/process_fuchsia.cc
index 9eb4d747ee9e2b3bbddae3619e70d67004e7cc18..88b115abf8dda9691151e2b559131fae9a8344a8 100644
--- a/runtime/bin/process_fuchsia.cc
+++ b/runtime/bin/process_fuchsia.cc
@@ -441,36 +441,6 @@ static bool ProcessWaitCleanup(intptr_t out,
}
-class BufferList : public BufferListBase {
- public:
- BufferList() {}
-
- bool Read(int fd, intptr_t available) {
- // Read all available bytes.
- while (available > 0) {
- if (free_size_ == 0) {
- Allocate();
- }
- ASSERT(free_size_ > 0);
- ASSERT(free_size_ <= kBufferSize);
- intptr_t block_size = dart::Utils::Minimum(free_size_, available);
- intptr_t bytes = NO_RETRY_EXPECTED(
- read(fd, reinterpret_cast<void*>(FreeSpaceAddress()), block_size));
- if (bytes < 0) {
- return false;
- }
- data_size_ += bytes;
- free_size_ -= bytes;
- available -= bytes;
- }
- return true;
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(BufferList);
-};
-
-
bool Process::Wait(intptr_t pid,
intptr_t in,
intptr_t out,
@@ -570,6 +540,8 @@ bool Process::Wait(intptr_t pid,
// All handles closed and all data read.
result->set_stdout_data(out_data.GetData());
result->set_stderr_data(err_data.GetData());
+ DEBUG_ASSERT(out_data.IsEmpty());
+ DEBUG_ASSERT(err_data.IsEmpty());
// Calculate the exit code.
intptr_t exit_code = exit_code_data.ints[0];
« no previous file with comments | « runtime/bin/process_android.cc ('k') | runtime/bin/process_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698