Compare commits

...

6 Commits

Author SHA1 Message Date
rsync-bugs
79a51e7ee6 preparing for release of 2.0.14 1998-05-29 02:29:33 +00:00
Andrew Tridgell
cad2bba7d8 fixed a bug in the flist sending code that caused the flist sending to
get out of sync.
1998-05-29 02:28:33 +00:00
Andrew Tridgell
fe8c0a9824 use Realloc instead of realloc 1998-05-28 06:40:25 +00:00
Andrew Tridgell
6cdc6b1344 fix realloc call for systems that don't handle realloc(NULL, ...) 1998-05-28 06:29:57 +00:00
Andrew Tridgell
05848a2cc7 don't do recursive deletion if the recurse option is not selected. 1998-05-28 05:05:26 +00:00
Andrew Tridgell
528bfcd79a cosmetic fix. don't display a EOF error when displaying just the motd
from a rsync server
1998-05-28 01:58:33 +00:00
9 changed files with 34 additions and 23 deletions

View File

@@ -146,11 +146,7 @@ void add_exclude_list(char *pattern,struct exclude_struct ***list, int include)
return;
}
if (!*list) {
*list = (struct exclude_struct **)malloc(sizeof(struct exclude_struct *)*2);
} else {
*list = (struct exclude_struct **)realloc(*list,sizeof(struct exclude_struct *)*(len+2));
}
*list = (struct exclude_struct **)Realloc(*list,sizeof(struct exclude_struct *)*(len+2));
if (!*list || !((*list)[len] = make_exclude(pattern, include)))
out_of_memory("add_exclude");

View File

@@ -169,6 +169,11 @@ void send_file_entry(struct file_struct *file,int f,unsigned base_flags)
if (l1 > 0) flags |= SAME_NAME;
if (l2 > 255) flags |= LONG_NAME;
/* we must make sure we don't send a zero flags byte or the other
end will terminate the flist transfer */
if (flags == 0 && !S_ISDIR(file->mode)) flags |= FLAG_DELETE;
if (flags == 0) flags |= LONG_NAME;
write_byte(f,flags);
if (flags & SAME_NAME)
write_byte(f,l1);

21
io.c
View File

@@ -32,10 +32,11 @@ static int io_multiplexing_in;
static int multiplex_in_fd;
static int multiplex_out_fd;
static time_t last_io;
static int eof_error=1;
extern int verbose;
extern int io_timeout;
int64 write_total(void)
{
return total_written;
@@ -119,7 +120,9 @@ static int read_timeout(int fd, char *buf, int len)
}
if (n == 0) {
rprintf(FERROR,"EOF in read_timeout\n");
if (eof_error) {
rprintf(FERROR,"EOF in read_timeout\n");
}
exit_cleanup(1);
}
@@ -142,7 +145,7 @@ static void read_loop(int fd, char *buf, int len)
}
}
/* read from the file descriptor handing multiplexing -
/* read from the file descriptor handling multiplexing -
return number of bytes read
never return <= 0 */
static int read_unbuffered(int fd, char *buf, int len)
@@ -220,10 +223,7 @@ static void read_check(int f)
if (n > (read_buffer_size - read_buffer_len)) {
read_buffer_size += n;
if (!read_buffer)
read_buffer = (char *)malloc(read_buffer_size);
else
read_buffer = (char *)realloc(read_buffer,read_buffer_size);
read_buffer = (char *)Realloc(read_buffer,read_buffer_size);
if (!read_buffer) out_of_memory("read check");
read_buffer_p = read_buffer;
}
@@ -482,8 +482,12 @@ void write_byte(int f,unsigned char c)
int read_line(int f, char *buf, int maxlen)
{
eof_error = 0;
while (maxlen) {
buf[0] = 0;
read_buf(f, buf, 1);
if (buf[0] == 0) return 0;
if (buf[0] == '\n') {
buf[0] = 0;
break;
@@ -497,6 +501,9 @@ int read_line(int f, char *buf, int maxlen)
*buf = 0;
return 0;
}
eof_error = 1;
return 1;
}

View File

@@ -47,7 +47,6 @@
#define BOOL int
#define False 0
#define True 1
#define Realloc realloc
#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((char *)(p1)) - (char *)(p2)))
#define strequal(a,b) (strcasecmp(a,b)==0)
#define BOOLSTR(b) ((b) ? "Yes" : "No")
@@ -368,6 +367,7 @@ static int add_a_service(service *pservice, char *name)
i = iNumServices;
ServicePtrs = (service **)Realloc(ServicePtrs,sizeof(service *)*num_to_alloc);
if (ServicePtrs)
pSERVICE(iNumServices) = (service *)malloc(sizeof(service));

View File

@@ -1,10 +1,10 @@
Summary: Program for efficient remote updates of files.
Name: rsync
Version: 2.0.13
Version: 2.0.14
Release: 1
Copyright: GPL
Group: Applications/Networking
Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.0.13.tar.gz
Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.0.14.tar.gz
URL: http://samba.anu.edu.au/rsync/
Packager: Andrew Tridgell <tridge@samba.anu.edu.au>
BuildRoot: /tmp/rsync

View File

@@ -77,7 +77,6 @@
#define BOOL int
#define False 0
#define True 1
#define Realloc realloc
/* -------------------------------------------------------------------------- **
* Constants...

10
rsync.c
View File

@@ -74,6 +74,7 @@ static int delete_file(char *fname)
extern int force_delete;
STRUCT_STAT st;
int ret;
extern int recurse;
if (do_unlink(fname) == 0 || errno == ENOENT) return 0;
@@ -93,7 +94,8 @@ static int delete_file(char *fname)
}
if (do_rmdir(fname) == 0 || errno == ENOENT) return 0;
if (!force_delete || (errno != ENOTEMPTY && errno != EEXIST)) {
if (!force_delete || !recurse ||
(errno != ENOTEMPTY && errno != EEXIST)) {
rprintf(FERROR,"rmdir(%s) : %s\n", fname, strerror(errno));
return -1;
}
@@ -636,11 +638,7 @@ static void add_delete_entry(struct file_struct *file)
{
if (dlist_len == dlist_alloc_len) {
dlist_alloc_len += 1024;
if (!delete_list) {
delete_list = (struct delete_list *)malloc(sizeof(delete_list[0])*dlist_alloc_len);
} else {
delete_list = (struct delete_list *)realloc(delete_list, sizeof(delete_list[0])*dlist_alloc_len);
}
delete_list = (struct delete_list *)Realloc(delete_list, sizeof(delete_list[0])*dlist_alloc_len);
if (!delete_list) out_of_memory("add_delete_entry");
}

6
util.c
View File

@@ -553,3 +553,9 @@ int slprintf(char *str, int n, char *format, ...)
return ret;
}
void *Realloc(void *p, int size)
{
if (!p) return (void *)malloc(size);
return (void *)realloc(p, size);
}

View File

@@ -1 +1 @@
#define VERSION "2.0.13"
#define VERSION "2.0.14"