extern int verbose;
extern int am_server;
extern int always_checksum;
-extern off_t total_size;
+extern int64 total_size;
extern int cvs_exclude;
*/
#include "rsync.h"
-static off_t total_written;
-static off_t total_read;
+static int64 total_written;
+static int64 total_read;
extern int verbose;
extern int sparse_files;
-off_t write_total(void)
+int64 write_total(void)
{
return total_written;
}
-off_t read_total(void)
+int64 read_total(void)
{
return total_read;
}
return IVAL(b,0);
}
-off_t read_longint(int f)
+int64 read_longint(int f)
{
extern int remote_version;
- off_t ret;
+ int64 ret;
char b[8];
ret = read_int(f);
- if (ret == -1 && remote_version >= 16) {
- if (sizeof(off_t) <= 4) {
- fprintf(FERROR,"Integer overflow - attempted 64 bit offset\n");
- exit_cleanup(1);
- }
+
+ if (ret != -1) return ret;
+
+#ifndef HAVE_LONGLONG
+ fprintf(FERROR,"Integer overflow - attempted 64 bit offset\n");
+ exit_cleanup(1);
+#else
+ if (remote_version >= 16) {
if ((ret=readfd(f,b,8)) != 8) {
if (verbose > 1)
fprintf(FERROR,"(%d) Error reading %d bytes : %s\n",
exit_cleanup(1);
}
total_read += 8;
- ret = IVAL(b,0) | (((off_t)IVAL(b,4))<<32);
+ ret = IVAL(b,0) | (((int64)IVAL(b,4))<<32);
}
+#endif
+
return ret;
}
total_written += 4;
}
-void write_longint(int f, off_t x)
+void write_longint(int f, int64 x)
{
extern int remote_version;
char b[8];
int verbose = 0;
int always_checksum = 0;
time_t starttime;
-off_t total_size = 0;
+int64 total_size = 0;
int block_size=BLOCK_SIZE;
char *backup_suffix = BACKUP_SUFFIX;
static void report(int f)
{
- off_t in,out,tsize;
+ int64 in,out,tsize;
time_t t = time(NULL);
if (!verbose) return;
{
char *args[100];
int i,argc=0, ret;
- char *tok,*p,*dir=NULL;
+ char *tok,*dir=NULL;
if (!local_server) {
if (!cmd)
static int total_false_alarms;
static int total_tag_hits;
static int total_matches;
-static off_t total_data_transfer;
+static int64 total_data_transfer;
struct target {
-off_t send_files(struct file_list *flist,int f_out,int f_in)
+void send_files(struct file_list *flist,int f_out,int f_in)
{
int fd;
struct sum_struct *s;
struct map_struct *buf;
struct stat st;
char fname[MAXPATHLEN];
- off_t total=0;
int i;
struct file_struct *file;
int phase = 0;
if (strlen(fname) == MAXPATHLEN-1) {
fprintf(FERROR, "send_files failed on long-named directory %s\n",
fname);
- return -1;
+ return;
}
strcat(fname,"/");
offset = strlen(file->basedir)+1;
s = receive_sums(f_in);
if (!s) {
fprintf(FERROR,"receive_sums failed\n");
- return -1;
+ return;
}
fd = open(fname,O_RDONLY);
fprintf(FERROR,"fstat failed : %s\n",strerror(errno));
free_sums(s);
close(fd);
- return -1;
+ return;
}
if (st.st_size > 0) {
if (verbose > 2)
fprintf(FERROR,"sender finished %s\n",fname);
-
- total += st.st_size;
}
if (verbose > 2)
write_int(f_out,-1);
write_flush(f_out);
-
- return total;
}
#define uint32 unsigned int32
#endif
+#ifdef HAVE_LONGLONG
+#define int64 long long
+#else
+#define int64 off_t
+#endif
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
/* we need this function because of the silly way in which duplicate
entries are handled in the file lists - we can't change this
without breaking existing versions */
-static int flist_up(struct file_list *flist, int i)
+static inline int flist_up(struct file_list *flist, int i)
{
while (!flist->files[i]->basename) i++;
return i;