The Samba-Bugzilla – Attachment 1003 Details for
Bug 2408
when more than --max-delete files are about to be deleted no error is returned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to limit the number of deletes before the deletes take place
max-delete.patch (text/plain), 1.34 KB, created by
Arthur de Jong
on 2005-03-02 08:28:10 UTC
(
hide
)
Description:
patch to limit the number of deletes before the deletes take place
Filename:
MIME Type:
Creator:
Arthur de Jong
Created:
2005-03-02 08:28:10 UTC
Size:
1.34 KB
patch
obsolete
>--- rsync-2.6.3.orig/receiver.c 2004-09-21 11:24:06.000000000 +0200 >+++ rsync-2.6.3/receiver.c 2005-03-02 15:41:26.000000000 +0100 >@@ -93,6 +93,7 @@ > int i, j; > char *argv[1], fbuf[MAXPATHLEN]; > static int deletion_count; >+ int deletion_test_count; > > if (cvs_exclude) > add_cvs_excludes(); >@@ -102,6 +103,38 @@ > return; > } > >+ /* if --max-delete is specified, check that not too many files will be deleted */ >+ if (max_delete) { >+ >+ /* count number of files that would be deleted */ >+ deletion_test_count=0; >+ >+ for (j = 0; j < flist->count; j++) { >+ if (!(flist->files[j]->flags & FLAG_TOP_DIR) >+ || !S_ISDIR(flist->files[j]->mode)) >+ continue; >+ >+ argv[0] = f_name_to(flist->files[j], fbuf); >+ >+ if (!(local_file_list = send_file_list(-1, 1, argv))) >+ continue; >+ >+ for (i = local_file_list->count-1; i >= 0; i--) { >+ if (!local_file_list->files[i]->basename) >+ continue; >+ if (flist_find(flist,local_file_list->files[i]) < 0) >+ deletion_test_count++; >+ } >+ flist_free(local_file_list); >+ } >+ >+ /* check deletion count */ >+ if ((deletion_count+deletion_test_count) >= max_delete) { >+ rprintf(FERROR,"too many files would be deleted - skipping file deletion\n"); >+ return; >+ } >+ } >+ > for (j = 0; j < flist->count; j++) { > if (!(flist->files[j]->flags & FLAG_TOP_DIR) > || !S_ISDIR(flist->files[j]->mode))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 2408
: 1003