Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/zfile.c: Use off_t instead of off64_t #1525

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/zfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <sys/types.h>

#ifdef __CYGWIN__
typedef _off64_t off64_t;
typedef _off64_t off_t;
#endif

#include <assert.h>
Expand Down Expand Up @@ -331,14 +331,14 @@ zfile_read(void *cookie_, char *buf, size_t size) {
}

static int
zfile_seek(void *cookie_, off64_t *offset_, int whence) {
zfile_seek(void *cookie_, off_t *offset_, int whence) {
struct zfile *cookie = cookie_;
off64_t new_offset = 0, offset = *offset_;
off_t new_offset = 0, offset = *offset_;

if (whence == SEEK_SET) {
new_offset = offset;
} else if (whence == SEEK_CUR) {
new_offset = (off64_t)cookie->logic_offset + offset;
new_offset = (off_t)cookie->logic_offset + offset;
} else {
/* SEEK_END not ok */
return -1;
Expand All @@ -348,7 +348,7 @@ zfile_seek(void *cookie_, off64_t *offset_, int whence) {
return -1;

/* Backward seeks to anywhere but 0 are not ok */
if (new_offset < (off64_t)cookie->logic_offset && new_offset != 0) {
if (new_offset < (off_t)cookie->logic_offset && new_offset != 0) {
return -1;
}

Expand Down