summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2003-08-30 14:44:04 +0000
committerLennart Poettering <lennart@poettering.net>2003-08-30 14:44:04 +0000
commit4c3f7894b1e9d48d76eccc382eea93a8ba9b74e9 (patch)
tree860984309d186e69ecff98f17be5d5e1f705f00e
parentec80e9432b3f547f34a4bc16c39047ea2132eaef (diff)
lfs fixes (incomplete)
git-svn-id: file:///home/lennart/svn/public/syrep/trunk@16 07ea20a6-d2c5-0310-9e02-9ef735347d72
-rw-r--r--src/Makefile2
-rw-r--r--src/util.c18
-rw-r--r--src/util.h2
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
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;
diff --git a/src/util.h b/src/util.h
index d16f0a6..8b34022 100644
--- a/src/util.h
+++ b/src/util.h
@@ -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);