Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
replace calls to strcmp() with a u_strcmp() function that uses only
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
138894f
..
7592069
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-21,12
+21,13
@@
#include "rsync.h"
#include "rsync.h"
+extern struct stats stats;
+
extern int csum_length;
extern int verbose;
extern int am_server;
extern int always_checksum;
extern int csum_length;
extern int verbose;
extern int am_server;
extern int always_checksum;
-extern int64 total_size;
extern int cvs_exclude;
extern int cvs_exclude;
@@
-421,7
+422,7
@@
static struct file_struct *make_file(char *fname)
}
if (!S_ISDIR(st.st_mode))
}
if (!S_ISDIR(st.st_mode))
- total_size += st.st_size;
+
stats.
total_size += st.st_size;
return file;
}
return file;
}
@@
-525,12
+526,15
@@
struct file_list *send_file_list(int f,int argc,char *argv[])
char *p,*dir;
char lastpath[MAXPATHLEN]="";
struct file_list *flist;
char *p,*dir;
char lastpath[MAXPATHLEN]="";
struct file_list *flist;
+ int64 start_write;
if (verbose && recurse && !am_server && f != -1) {
rprintf(FINFO,"building file list ... ");
rflush(FINFO);
}
if (verbose && recurse && !am_server && f != -1) {
rprintf(FINFO,"building file list ... ");
rflush(FINFO);
}
+ start_write = stats.total_written;
+
flist = (struct file_list *)malloc(sizeof(flist[0]));
if (!flist) out_of_memory("send_file_list");
flist = (struct file_list *)malloc(sizeof(flist[0]));
if (!flist) out_of_memory("send_file_list");
@@
-651,6
+655,8
@@
struct file_list *send_file_list(int f,int argc,char *argv[])
if (f != -1) {
io_end_buffering(f);
if (f != -1) {
io_end_buffering(f);
+ stats.flist_size = stats.total_written - start_write;
+ stats.num_files = flist->count;
}
if (verbose > 2)
}
if (verbose > 2)
@@
-664,12
+670,15
@@
struct file_list *recv_file_list(int f)
{
struct file_list *flist;
unsigned char flags;
{
struct file_list *flist;
unsigned char flags;
+ int64 start_read;
if (verbose && recurse && !am_server) {
rprintf(FINFO,"receiving file list ... ");
rflush(FINFO);
}
if (verbose && recurse && !am_server) {
rprintf(FINFO,"receiving file list ... ");
rflush(FINFO);
}
+ start_read = stats.total_read;
+
flist = (struct file_list *)malloc(sizeof(flist[0]));
if (!flist)
goto oom;
flist = (struct file_list *)malloc(sizeof(flist[0]));
if (!flist)
goto oom;
@@
-700,7
+709,7
@@
struct file_list *recv_file_list(int f)
receive_file_entry(&flist->files[i],flags,f);
if (S_ISREG(flist->files[i]->mode))
receive_file_entry(&flist->files[i],flags,f);
if (S_ISREG(flist->files[i]->mode))
- total_size += flist->files[i]->length;
+
stats.
total_size += flist->files[i]->length;
flist->count++;
flist->count++;
@@
-731,6
+740,9
@@
struct file_list *recv_file_list(int f)
if (verbose > 2)
rprintf(FINFO,"recv_file_list done\n");
if (verbose > 2)
rprintf(FINFO,"recv_file_list done\n");
+ stats.flist_size = stats.total_read - start_read;
+ stats.num_files = flist->count;
+
return flist;
oom:
return flist;
oom:
@@
-745,8
+757,8
@@
int file_compare(struct file_struct **f1,struct file_struct **f2)
if (!(*f1)->basename) return -1;
if (!(*f2)->basename) return 1;
if ((*f1)->dirname == (*f2)->dirname)
if (!(*f1)->basename) return -1;
if (!(*f2)->basename) return 1;
if ((*f1)->dirname == (*f2)->dirname)
- return strcmp((*f1)->basename, (*f2)->basename);
- return strcmp(f_name(*f1),f_name(*f2));
+ return
u_
strcmp((*f1)->basename, (*f2)->basename);
+ return
u_
strcmp(f_name(*f1),f_name(*f2));
}
}