Fix lseek() check

Since 'pos' is unsigned, we need to tweak the check.

Test: TreeHugger
Change-Id: I97dcb50fb86196b09b11ba725593e6c83c5586d9
This commit is contained in:
Greg Kaiser 2020-10-26 06:29:14 -07:00
parent 346e6792b4
commit 74b8449f58

View file

@ -135,7 +135,7 @@ bool CowReader::ParseOps() {
}
auto& current_op = ops_buffer->data()[current_op_num];
pos = lseek(fd_.get(), GetNextOpOffset(current_op), SEEK_CUR);
if (pos < 0) {
if (pos == uint64_t(-1)) {
PLOG(ERROR) << "lseek next op failed";
return false;
}