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
- Added older news from NEWS file.
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
e905a18
..
6f20e83
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-282,7
+282,7
@@
static int flist_dir_len;
**/
void flist_expand(struct file_list *flist)
{
**/
void flist_expand(struct file_list *flist)
{
-
void
*new_ptr;
+
struct file_struct *
*new_ptr;
if (flist->count < flist->malloced)
return;
if (flist->count < flist->malloced)
return;
@@
-301,12
+301,8
@@
void flist_expand(struct file_list *flist)
if (flist->malloced < flist->count)
flist->malloced = flist->count;
if (flist->malloced < flist->count)
flist->malloced = flist->count;
- if (flist->files) {
- new_ptr = realloc_array(flist->files,
- struct file_struct *, flist->malloced);
- } else {
- new_ptr = new_array(struct file_struct *, flist->malloced);
- }
+ new_ptr = realloc_array(flist->files, struct file_struct *,
+ flist->malloced);
if (verbose >= 2) {
rprintf(FINFO, "[%s] expand file_list to %.0f bytes, did%s move\n",
if (verbose >= 2) {
rprintf(FINFO, "[%s] expand file_list to %.0f bytes, did%s move\n",
@@
-315,7
+311,7
@@
void flist_expand(struct file_list *flist)
(new_ptr == flist->files) ? " not" : "");
}
(new_ptr == flist->files) ? " not" : "");
}
- flist->files =
(struct file_struct **)
new_ptr;
+ flist->files = new_ptr;
if (!flist->files)
out_of_memory("flist_expand");
if (!flist->files)
out_of_memory("flist_expand");
@@
-332,7
+328,7
@@
void send_file_entry(struct file_struct *file, int f, unsigned short base_flags)
static uid_t uid;
static gid_t gid;
static char lastname[MAXPATHLEN];
static uid_t uid;
static gid_t gid;
static char lastname[MAXPATHLEN];
- char
*fname, fbuf
[MAXPATHLEN];
+ char
fname
[MAXPATHLEN];
int l1, l2;
if (f == -1)
int l1, l2;
if (f == -1)
@@
-350,7
+346,7
@@
void send_file_entry(struct file_struct *file, int f, unsigned short base_flags)
io_write_phase = "send_file_entry";
io_write_phase = "send_file_entry";
- f
name = f_name_to(file, fbuf
);
+ f
_name_to(file, fname
);
flags = base_flags;
flags = base_flags;
@@
-778,8
+774,8
@@
struct file_struct *make_file(char *fname,
}
else {
io_error |= IOERR_GENERAL;
}
else {
io_error |= IOERR_GENERAL;
- r
printf(FERROR, "readlink %s failed: %s\n
",
-
full_fname(thisname), strerror(save_errno
));
+ r
syserr(FERROR, save_errno, "readlink %s failed
",
+
full_fname(thisname
));
}
return NULL;
}
}
return NULL;
}
@@
-953,7
+949,7
@@
void send_file_name(int f, struct file_list *flist, char *fname,
rprintf(FINFO, "[%s] popping %sexclude list\n",
who_am_i(), local_exclude_list.debug_type);
}
rprintf(FINFO, "[%s] popping %sexclude list\n",
who_am_i(), local_exclude_list.debug_type);
}
-
free
_exclude_list(&local_exclude_list);
+
clear
_exclude_list(&local_exclude_list);
local_exclude_list = last_list;
}
}
local_exclude_list = last_list;
}
}
@@
-970,8
+966,7
@@
static void send_directory(int f, struct file_list *flist, char *dir)
d = opendir(dir);
if (!d) {
io_error |= IOERR_GENERAL;
d = opendir(dir);
if (!d) {
io_error |= IOERR_GENERAL;
- rprintf(FERROR, "opendir %s failed: %s\n",
- full_fname(dir), strerror(errno));
+ rsyserr(FERROR, errno, "opendir %s failed", full_fname(dir));
return;
}
return;
}
@@
-1018,8
+1013,7
@@
static void send_directory(int f, struct file_list *flist, char *dir)
}
if (errno) {
io_error |= IOERR_GENERAL;
}
if (errno) {
io_error |= IOERR_GENERAL;
- rprintf(FERROR, "readdir(%s): (%d) %s\n",
- dir, errno, strerror(errno));
+ rsyserr(FERROR, errno, "readdir(%s)", dir);
}
closedir(d);
}
closedir(d);
@@
-1054,8
+1048,8
@@
struct file_list *send_file_list(int f, int argc, char *argv[])
io_start_buffering_out(f);
if (filesfrom_fd >= 0) {
if (argv[0] && !push_dir(argv[0])) {
io_start_buffering_out(f);
if (filesfrom_fd >= 0) {
if (argv[0] && !push_dir(argv[0])) {
- r
printf(FERROR, "push_dir %s failed: %s\n
",
- full_fname(argv[0])
, strerror(errno)
);
+ r
syserr(FERROR, errno, "push_dir %s failed
",
+ full_fname(argv[0]));
exit_cleanup(RERR_FILESELECT);
}
use_ff_fd = 1;
exit_cleanup(RERR_FILESELECT);
}
use_ff_fd = 1;
@@
-1092,8
+1086,8
@@
struct file_list *send_file_list(int f, int argc, char *argv[])
if (link_stat(fname, &st) != 0) {
if (f != -1) {
io_error |= IOERR_GENERAL;
if (link_stat(fname, &st) != 0) {
if (f != -1) {
io_error |= IOERR_GENERAL;
- r
printf(FERROR, "link_stat %s failed: %s\n
",
- full_fname(fname)
, strerror(errno)
);
+ r
syserr(FERROR, errno, "link_stat %s failed
",
+ full_fname(fname));
}
continue;
}
}
continue;
}
@@
-1162,8
+1156,8
@@
struct file_list *send_file_list(int f, int argc, char *argv[])
if (!push_dir(dir)) {
io_error |= IOERR_GENERAL;
if (!push_dir(dir)) {
io_error |= IOERR_GENERAL;
- r
printf(FERROR, "push_dir %s failed: %s\n
",
- full_fname(dir)
, strerror(errno)
);
+ r
syserr(FERROR, errno, "push_dir %s failed
",
+ full_fname(dir));
continue;
}
continue;
}
@@
-1185,8
+1179,8
@@
struct file_list *send_file_list(int f, int argc, char *argv[])
flist_dir = NULL;
flist_dir_len = 0;
if (!pop_dir(olddir)) {
flist_dir = NULL;
flist_dir_len = 0;
if (!pop_dir(olddir)) {
- r
printf(FERROR, "pop_dir %s failed: %s\n
",
- full_fname(dir)
, strerror(errno)
);
+ r
syserr(FERROR, errno, "pop_dir %s failed
",
+ full_fname(dir));
exit_cleanup(RERR_FILESELECT);
}
}
exit_cleanup(RERR_FILESELECT);
}
}