Fixed a compile error which tries to check whether a size_t < 0 in env_posix.cc

Summary:
Fixed a compile error which tries to check whether a size_t < 0 in env_posix.cc

util/env_posix.cc:180:16: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
    } while (r < 0 && errno == EINTR);
             ~ ^ ~
1 error generated.

Test Plan: make check all

Reviewers: igor, haobo

Reviewed By: igor

CC: leveldb

Differential Revision: https://reviews.facebook.net/D17379
main
Yueh-Hsuan Chiang 11 years ago
parent a73383e8ac
commit fa84eb1f7b
  1. 4
      util/env_posix.cc

@ -174,10 +174,10 @@ class PosixSequentialFile: public SequentialFile {
virtual Status Read(size_t n, Slice* result, char* scratch) {
Status s;
size_t r = -1;
size_t r = 0;
do {
r = fread_unlocked(scratch, 1, n, file_);
} while (r < 0 && errno == EINTR);
} while (r == 0 && ferror(file_) && errno == EINTR);
*result = Slice(scratch, r);
if (r < n) {
if (feof(file_)) {

Loading…
Cancel
Save