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
Switched a buffer name in make_file() to make the code a little more
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
263af26
..
c4459b1
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-342,7
+342,8
@@
static void flist_expand(struct file_list *flist)
}
if (verbose >= 2) {
}
if (verbose >= 2) {
- rprintf(FINFO, "expand file_list to %.0f bytes, did%s move\n",
+ rprintf(FINFO, "[%s] expand file_list to %.0f bytes, did%s move\n",
+ who_am_i(),
(double)sizeof(flist->files[0])
* flist->malloced,
(new_ptr == flist->files) ? " not" : "");
(double)sizeof(flist->files[0])
* flist->malloced,
(new_ptr == flist->files) ? " not" : "");
@@
-723,36
+724,35
@@
struct file_struct *make_file(char *fname, struct string_area **ap,
STRUCT_STAT st;
char sum[SUM_LENGTH];
char *p;
STRUCT_STAT st;
char sum[SUM_LENGTH];
char *p;
- char
cleaned_
name[MAXPATHLEN];
+ char
this
name[MAXPATHLEN];
char linkbuf[MAXPATHLEN];
unsigned short flags = 0;
char linkbuf[MAXPATHLEN];
unsigned short flags = 0;
- if (strlcpy(
cleaned_name, fname, sizeof cleaned_
name)
- >= sizeof
cleaned_
name - flist_dir_len) {
+ if (strlcpy(
thisname, fname, sizeof this
name)
+ >= sizeof
this
name - flist_dir_len) {
rprintf(FINFO, "skipping overly long name: %s\n", fname);
return NULL;
}
rprintf(FINFO, "skipping overly long name: %s\n", fname);
return NULL;
}
- clean_fname(
cleaned_
name);
+ clean_fname(
this
name);
if (sanitize_paths)
if (sanitize_paths)
- sanitize_path(cleaned_name, NULL);
- fname = cleaned_name;
+ sanitize_path(thisname, NULL);
memset(sum, 0, SUM_LENGTH);
memset(sum, 0, SUM_LENGTH);
- if (readlink_stat(
f
name, &st, linkbuf) != 0) {
+ if (readlink_stat(
this
name, &st, linkbuf) != 0) {
int save_errno = errno;
if (errno == ENOENT && exclude_level != NO_EXCLUDES) {
/* either symlink pointing nowhere or file that
* was removed during rsync run; see if excluded
* before reporting an error */
int save_errno = errno;
if (errno == ENOENT && exclude_level != NO_EXCLUDES) {
/* either symlink pointing nowhere or file that
* was removed during rsync run; see if excluded
* before reporting an error */
- if (check_exclude_file(
f
name, 0, exclude_level)) {
+ if (check_exclude_file(
this
name, 0, exclude_level)) {
/* file is excluded anyway, ignore silently */
return NULL;
}
}
io_error |= IOERR_GENERAL;
rprintf(FERROR, "readlink %s failed: %s\n",
/* file is excluded anyway, ignore silently */
return NULL;
}
}
io_error |= IOERR_GENERAL;
rprintf(FERROR, "readlink %s failed: %s\n",
- full_fname(
f
name), strerror(save_errno));
+ full_fname(
this
name), strerror(save_errno));
return NULL;
}
return NULL;
}
@@
-761,7
+761,7
@@
struct file_struct *make_file(char *fname, struct string_area **ap,
goto skip_excludes;
if (S_ISDIR(st.st_mode) && !recurse && !files_from) {
goto skip_excludes;
if (S_ISDIR(st.st_mode) && !recurse && !files_from) {
- rprintf(FINFO, "skipping directory %s\n",
f
name);
+ rprintf(FINFO, "skipping directory %s\n",
this
name);
return NULL;
}
return NULL;
}
@@
-773,16
+773,18
@@
struct file_struct *make_file(char *fname, struct string_area **ap,
flags |= FLAG_MOUNT_POINT;
}
flags |= FLAG_MOUNT_POINT;
}
- if (check_exclude_file(
f
name, S_ISDIR(st.st_mode) != 0, exclude_level))
+ if (check_exclude_file(
this
name, S_ISDIR(st.st_mode) != 0, exclude_level))
return NULL;
return NULL;
- if (lp_ignore_nonreadable(module_id) && access(
f
name, R_OK) != 0)
+ if (lp_ignore_nonreadable(module_id) && access(
this
name, R_OK) != 0)
return NULL;
skip_excludes:
return NULL;
skip_excludes:
- if (verbose > 2)
- rprintf(FINFO, "make_file(%s,*,%d)\n", fname, exclude_level);
+ if (verbose > 2) {
+ rprintf(FINFO, "[%s] make_file(%s,*,%d)\n",
+ who_am_i(), thisname, exclude_level);
+ }
file = new(struct file_struct);
if (!file)
file = new(struct file_struct);
if (!file)
@@
-790,20
+792,20
@@
struct file_struct *make_file(char *fname, struct string_area **ap,
memset((char *) file, 0, sizeof(*file));
file->flags = flags;
memset((char *) file, 0, sizeof(*file));
file->flags = flags;
- if ((p = strrchr(
f
name, '/'))) {
+ if ((p = strrchr(
this
name, '/'))) {
static char *lastdir;
*p = 0;
static char *lastdir;
*p = 0;
- if (lastdir && strcmp(
f
name, lastdir) == 0)
+ if (lastdir && strcmp(
this
name, lastdir) == 0)
file->dirname = lastdir;
else {
file->dirname = lastdir;
else {
- file->dirname = strdup(
f
name);
+ file->dirname = strdup(
this
name);
lastdir = file->dirname;
}
file->basename = STRDUP(ap, p + 1);
*p = '/';
} else {
file->dirname = NULL;
lastdir = file->dirname;
}
file->basename = STRDUP(ap, p + 1);
*p = '/';
} else {
file->dirname = NULL;
- file->basename = STRDUP(ap,
f
name);
+ file->basename = STRDUP(ap,
this
name);
}
file->modtime = st.st_mtime;
}
file->modtime = st.st_mtime;
@@
-833,7
+835,7
@@
struct file_struct *make_file(char *fname, struct string_area **ap,
if (always_checksum && S_ISREG(st.st_mode)) {
if (!(file->u.sum = (char*)MALLOC(ap, MD4_SUM_LENGTH)))
out_of_memory("md4 sum");
if (always_checksum && S_ISREG(st.st_mode)) {
if (!(file->u.sum = (char*)MALLOC(ap, MD4_SUM_LENGTH)))
out_of_memory("md4 sum");
- file_checksum(
f
name, file->u.sum, st.st_size);
+ file_checksum(
this
name, file->u.sum, st.st_size);
}
file->basedir = flist_dir;
}
file->basedir = flist_dir;
@@
-1414,8
+1416,8
@@
static void clean_flist(struct file_list *flist, int strip_root, int no_dups)
return;
for (i = 0; i < flist->count; i++) {
return;
for (i = 0; i < flist->count; i++) {
- rprintf(FINFO, "[%
ld
] i=%d %s %s %s mode=0%o len=%.0f\n",
-
(long) getpid
(), i,
+ rprintf(FINFO, "[%
s
] i=%d %s %s %s mode=0%o len=%.0f\n",
+
who_am_i
(), i,
NS(flist->files[i]->basedir),
NS(flist->files[i]->dirname),
NS(flist->files[i]->basename),
NS(flist->files[i]->basedir),
NS(flist->files[i]->dirname),
NS(flist->files[i]->basename),