Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5d2c5c4
)
With -vv, when the file list grows, show a message.
author
Martin Pool
<mbp@samba.org>
Fri, 25 Jan 2002 10:12:02 +0000
(10:12 +0000)
committer
Martin Pool
<mbp@samba.org>
Fri, 25 Jan 2002 10:12:02 +0000
(10:12 +0000)
flist.c
patch
|
blob
|
blame
|
history
diff --git
a/flist.c
b/flist.c
index
0761497
..
8ec488c
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-279,13
+279,26
@@
static char *flist_dir;
static void flist_expand(struct file_list *flist)
{
if (flist->count >= flist->malloced) {
static void flist_expand(struct file_list *flist)
{
if (flist->count >= flist->malloced) {
+ size_t new_bytes;
+ void *new_ptr;
+
if (flist->malloced < 1000)
flist->malloced += 1000;
else
flist->malloced *= 2;
if (flist->malloced < 1000)
flist->malloced += 1000;
else
flist->malloced *= 2;
- flist->files = (struct file_struct **)
- realloc(flist->files,
- sizeof(flist->files[0]) * flist->malloced);
+
+ new_bytes = sizeof(flist->files[0]) * flist->malloced;
+
+ new_ptr = realloc(flist->files, new_bytes);
+
+ if (verbose > 2) {
+ rprintf(FINFO, RSYNC_NAME ": expand file_list to %.0f bytes, did%s move\n",
+ (double) new_bytes,
+ (new_ptr == flist->files) ? " not" : "");
+ }
+
+ flist->files = (struct file_struct **) new_ptr;
+
if (!flist->files)
out_of_memory("flist_expand");
}
if (!flist->files)
out_of_memory("flist_expand");
}