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
This commit is contained in:
parent
a73383e8ac
commit
fa84eb1f7b
@ -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…
Reference in New Issue
Block a user