rsyncfile.c (185094) | rsyncfile.c (185128) |
---|---|
1/*- 2 * Copyright (c) 2008, Ulf Lilleengen <lulf@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2008, Ulf Lilleengen <lulf@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: projects/csup_cvsmode/contrib/csup/rsyncfile.c 185094 2008-11-19 14:57:00Z lulf $ | 26 * $FreeBSD: projects/csup_cvsmode/contrib/csup/rsyncfile.c 185128 2008-11-20 12:23:44Z lulf $ |
27 */ 28 29#include <errno.h> 30#include <string.h> 31#include <stdlib.h> 32#include <stdio.h> 33 34#include <sys/types.h> --- 100 unchanged lines hidden (view full) --- 135 losearch = MINBLOCKSIZE; 136 hisearch = losearch + (2 * SEARCHREGION); 137 } else if (hisearch > MAXBLOCKSIZE) { 138 hisearch = MAXBLOCKSIZE; 139 losearch = hisearch - (2 * SEARCHREGION); 140 } 141 142 bestrem = MAXBLOCKSIZE; | 27 */ 28 29#include <errno.h> 30#include <string.h> 31#include <stdlib.h> 32#include <stdio.h> 33 34#include <sys/types.h> --- 100 unchanged lines hidden (view full) --- 135 losearch = MINBLOCKSIZE; 136 hisearch = losearch + (2 * SEARCHREGION); 137 } else if (hisearch > MAXBLOCKSIZE) { 138 hisearch = MAXBLOCKSIZE; 139 losearch = hisearch - (2 * SEARCHREGION); 140 } 141 142 bestrem = MAXBLOCKSIZE; |
143 for (bs = losearch; bs <= hisearch;) { | 143 for (bs = losearch; bs <= hisearch; bs++) { |
144 rem = fsize % bs; 145 if (rem < bestrem) { 146 bestrem = rem; 147 blocksize = bs; 148 } 149 } 150 return (bestrem); 151} --- 75 unchanged lines hidden --- | 144 rem = fsize % bs; 145 if (rem < bestrem) { 146 bestrem = rem; 147 blocksize = bs; 148 } 149 } 150 return (bestrem); 151} --- 75 unchanged lines hidden --- |