diff options
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/util.c | 18 | ||||
-rw-r--r-- | src/util.h | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/Makefile b/src/Makefile index 2032e76..9f74fd3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,4 @@ -CFLAGS=-Wall -pipe -O0 -g -DARCH_IS_BIG_ENDIAN=0 +CFLAGS=-Wall -pipe -O0 -g -DARCH_IS_BIG_ENDIAN=0 -D_FILE_OFFSET_BITS=64 CC=gcc all: syrep @@ -156,7 +156,7 @@ int isdirectory(const char *path) { #ifdef USE_SENDFILE -static int copy_fd_sendfile(int sfd, int dfd, uint32_t l) { +static int copy_fd_sendfile(int sfd, int dfd, size_t l) { off_t sfo, o; ssize_t r; @@ -180,7 +180,7 @@ static int copy_fd_sendfile(int sfd, int dfd, uint32_t l) { #endif -int filesize(int fd) { +off_t filesize(int fd) { struct stat st; if (fstat(fd, &st) < 0) { @@ -191,8 +191,8 @@ int filesize(int fd) { return st.st_size; } -int expand_file(int fd, size_t l) { - size_t s; +int expand_file(int fd, off_t l) { + off_t s; if ((s = filesize(fd)) < 0) return -1; @@ -209,11 +209,11 @@ int expand_file(int fd, size_t l) { #define MMAPSIZE (100*1024*1024) #define BUFSIZE (32*1024) -int copy_fd(int sfd, int dfd, size_t l) { +int copy_fd(int sfd, int dfd, off_t l) { off_t sfo, dfo, msfo, mdfo; void *sp, *dp; - size_t m, sm, dm; - static size_t psize = 0; + off_t m, sm, dm; + static off_t psize = 0; #ifdef USE_SENDFILE if (!copy_fd_sendfile(sfd, dfd, l)) @@ -232,7 +232,7 @@ int copy_fd(int sfd, int dfd, size_t l) { m = l < MMAPSIZE ? l : MMAPSIZE; if ((sfo = lseek(sfd, 0, SEEK_CUR)) != (off_t) -1) { - size_t s; + off_t s; if ((s = filesize(sfd)) < 0) return -1; @@ -267,7 +267,7 @@ int copy_fd(int sfd, int dfd, size_t l) { } while (l > 0) { - ssize_t n; + off_t n; m = l > BUFSIZE ? BUFSIZE : l; @@ -35,7 +35,7 @@ void rotdash_hide(void); const char* get_snapshot_filename(const char *path, const char *fn); const char* get_attached_filename(const char *root, const char *fn); int isdirectory(const char *path); -int copy_fd(int sfd, int dfd, size_t l); +int copy_fd(int sfd, int dfd, off_t l); int copy_file(const char *src, const char *dst, int c); int move_file(const char *src, const char *dst, int c); int copy_or_link_file(const char *src, const char *dst, int c); |