summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/util.c b/src/util.c
index 7067428..5040259 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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;