diff options
Diffstat (limited to 'src/import')
-rw-r--r-- | src/import/import-raw.c | 4 | ||||
-rw-r--r-- | src/import/pull-job.c | 2 | ||||
-rw-r--r-- | src/import/pull-raw.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c index feb6ac1bdd..2db3198ba6 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -303,7 +303,7 @@ static int raw_import_open_disk(RawImport *i) { "Target file is not a regular file or block device"); if (i->offset != UINT64_MAX) { - if (lseek(i->output_fd, i->offset, SEEK_SET) == (off_t) -1) + if (lseek(i->output_fd, i->offset, SEEK_SET) < 0) return log_error_errno(errno, "Failed to seek to offset: %m"); } @@ -328,7 +328,7 @@ static int raw_import_try_reflink(RawImport *i) { return 0; p = lseek(i->input_fd, 0, SEEK_CUR); - if (p == (off_t) -1) + if (p < 0) return log_error_errno(errno, "Failed to read file offset of input file: %m"); /* Let's only try a btrfs reflink, if we are reading from the beginning of the file */ diff --git a/src/import/pull-job.c b/src/import/pull-job.c index d05bf3cd49..bed7e64030 100644 --- a/src/import/pull-job.c +++ b/src/import/pull-job.c @@ -415,7 +415,7 @@ static int pull_job_open_disk(PullJob *j) { return log_error_errno(errno, "Failed to stat disk file: %m"); if (j->offset != UINT64_MAX) { - if (lseek(j->disk_fd, j->offset, SEEK_SET) == (off_t) -1) + if (lseek(j->disk_fd, j->offset, SEEK_SET) < 0) return log_error_errno(errno, "Failed to seek on file descriptor: %m"); } } diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c index 3befa96a04..e96be4dd7d 100644 --- a/src/import/pull-raw.c +++ b/src/import/pull-raw.c @@ -370,7 +370,7 @@ static int raw_pull_make_local_copy(RawPull *i) { assert(i->raw_job->disk_fd >= 0); assert(i->offset == UINT64_MAX); - if (lseek(i->raw_job->disk_fd, SEEK_SET, 0) == (off_t) -1) + if (lseek(i->raw_job->disk_fd, SEEK_SET, 0) < 0) return log_error_errno(errno, "Failed to seek to beginning of vendor image: %m"); } |