tree-wide: check if return value of lseek() and friends is negative
We usually check return value of syscalls or glibc functions by it is negative or not, something like that `if (stat(path, &st) < 0)`. Let's also use the same style for lseek() and friends even the type of their return value is off_t. Note, fseeko() returns int, instead of off_t.
This commit is contained in:
+1
-1
@@ -283,7 +283,7 @@ ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length) {
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (lseek(fd, n, SEEK_CUR) == (off_t) -1)
|
||||
if (lseek(fd, n, SEEK_CUR) < 0)
|
||||
return -errno;
|
||||
|
||||
q += n;
|
||||
|
||||
Reference in New Issue
Block a user