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

Unified Diff: remoting/host/linux/audio_pipe_reader.cc

Issue 11744009: Fix AudioPipeReader to handle EOF properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/linux/audio_pipe_reader.cc
diff --git a/remoting/host/linux/audio_pipe_reader.cc b/remoting/host/linux/audio_pipe_reader.cc
index 82d832e24d6cd4378b4278090c6be8435fa47782..12ae46006115147be403446a067bbd217de6dbe3 100644
--- a/remoting/host/linux/audio_pipe_reader.cc
+++ b/remoting/host/linux/audio_pipe_reader.cc
@@ -145,10 +145,10 @@ void AudioPipeReader::DoCapture() {
while (pos < data.size()) {
int read_result = HANDLE_EINTR(
read(pipe_fd_, string_as_array(&data) + pos, data.size() - pos));
- if (read_result >= 0) {
+ if (read_result > 0) {
pos += read_result;
} else {
- if (errno != EWOULDBLOCK && errno != EAGAIN)
+ if (read_result < 0 && errno != EWOULDBLOCK && errno != EAGAIN)
PLOG(ERROR) << "read";
Lambros 2013/01/02 22:51:28 optional: PLOG_IF(ERROR, condition) <<..
Sergey Ulanov 2013/01/02 23:02:20 I don't think PLOG_IF() would make this code more
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698