Skip to content

Commit

Permalink
Bug 1287739: Always set 'len' variable in storage test, r=mak
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 8EpGeakICWY
  • Loading branch information
tdz committed Jul 20, 2016
1 parent 2677e26 commit 3eace08
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions storage/test/test_deadlock_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ class Subprocess
int32_t nfds;
bool stdoutOpen = true, stderrOpen = true;
char buf[4096];
int32_t len;

PRIntervalTime now = PR_IntervalNow();
PRIntervalTime deadline = now + PR_MillisecondsToInterval(aWaitMs);
Expand Down Expand Up @@ -194,15 +193,13 @@ class Subprocess
continue;

bool isStdout = mStdoutfd == pollfds[i].fd;

int32_t len = 0;

if (PR_POLL_READ & pollfds[i].out_flags) {
len = PR_Read(pollfds[i].fd, buf, sizeof(buf) - 1);
NS_ASSERTION(0 <= len, PR_ErrorToName(PR_GetError()));
}
else if (PR_POLL_HUP & pollfds[i].out_flags) {
len = 0;
}
else {
else if (!(PR_POLL_HUP & pollfds[i].out_flags)) {
NS_ERROR(PR_ErrorToName(PR_GetError()));
}

Expand Down

0 comments on commit 3eace08

Please sign in to comment.