mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-02-18 15:16:24 -05:00
Use new send_msg_int() function.
This commit is contained in:
@@ -1435,11 +1435,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
|
||||
if (remove_source_files != 1)
|
||||
return;
|
||||
return_with_success:
|
||||
if (!dry_run) {
|
||||
char numbuf[4];
|
||||
SIVAL(numbuf, 0, ndx);
|
||||
send_msg(MSG_SUCCESS, numbuf, 4);
|
||||
}
|
||||
if (!dry_run)
|
||||
send_msg_int(MSG_SUCCESS, ndx);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
18
hlink.c
18
hlink.c
@@ -50,10 +50,10 @@ static int hlink_compare(int *int1, int *int2)
|
||||
struct idev *i2 = F_IDEV(f2);
|
||||
|
||||
if (i1->dev != i2->dev)
|
||||
return (int)(i1->dev > i2->dev ? 1 : -1);
|
||||
return i1->dev > i2->dev ? 1 : -1;
|
||||
|
||||
if (i1->ino != i2->ino)
|
||||
return (int)(i1->ino > i2->ino ? 1 : -1);
|
||||
return i1->ino > i2->ino ? 1 : -1;
|
||||
|
||||
return f_name_cmp(f1, f2);
|
||||
}
|
||||
@@ -245,11 +245,8 @@ int hard_link_check(struct file_struct *file, int ndx, char *fname,
|
||||
}
|
||||
maybe_hard_link(file, ndx, fname, statret, st,
|
||||
toname, &st2, itemizing, code);
|
||||
if (remove_source_files == 1 && do_xfers) {
|
||||
char numbuf[4];
|
||||
SIVAL(numbuf, 0, ndx);
|
||||
send_msg(MSG_SUCCESS, numbuf, 4);
|
||||
}
|
||||
if (remove_source_files == 1 && do_xfers)
|
||||
send_msg_int(MSG_SUCCESS, ndx);
|
||||
hl->hlindex = FINISHED_LINK;
|
||||
} else
|
||||
hl->hlindex = SKIPPED_LINK;
|
||||
@@ -320,11 +317,8 @@ void hard_link_cluster(struct file_struct *file, int master, int itemizing,
|
||||
statret = link_stat(hlink2, &st2, 0);
|
||||
maybe_hard_link(file, ndx, hlink2, statret, &st2,
|
||||
hlink1, &st1, itemizing, code);
|
||||
if (remove_source_files == 1 && do_xfers) {
|
||||
char numbuf[4];
|
||||
SIVAL(numbuf, 0, ndx);
|
||||
send_msg(MSG_SUCCESS, numbuf, 4);
|
||||
}
|
||||
if (remove_source_files == 1 && do_xfers)
|
||||
send_msg_int(MSG_SUCCESS, ndx);
|
||||
hl->hlindex = FINISHED_LINK;
|
||||
} while (!(file->flags & FLAG_HLINK_LAST));
|
||||
#endif
|
||||
|
||||
22
receiver.c
22
receiver.c
@@ -280,7 +280,7 @@ static void discard_receive_data(int f_in, OFF_T length)
|
||||
|
||||
static void handle_delayed_updates(struct file_list *flist, char *local_name)
|
||||
{
|
||||
char *fname, *partialptr, numbuf[4];
|
||||
char *fname, *partialptr;
|
||||
int i;
|
||||
|
||||
for (i = -1; (i = bitbag_next_bit(delayed_bits, i)) >= 0; ) {
|
||||
@@ -301,10 +301,8 @@ static void handle_delayed_updates(struct file_list *flist, char *local_name)
|
||||
full_fname(fname), partialptr);
|
||||
} else {
|
||||
if (remove_source_files
|
||||
|| (preserve_hard_links && IS_HLINKED(file))) {
|
||||
SIVAL(numbuf, 0, i);
|
||||
send_msg(MSG_SUCCESS,numbuf,4);
|
||||
}
|
||||
|| (preserve_hard_links && IS_HLINKED(file)))
|
||||
send_msg_int(MSG_SUCCESS, i);
|
||||
handle_partial_dir(partialptr, PDIR_DELETE);
|
||||
}
|
||||
}
|
||||
@@ -341,7 +339,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
|
||||
char *fname, fbuf[MAXPATHLEN];
|
||||
char xname[MAXPATHLEN];
|
||||
char fnametmp[MAXPATHLEN];
|
||||
char *fnamecmp, *partialptr, numbuf[4];
|
||||
char *fnamecmp, *partialptr;
|
||||
char fnamecmpbuf[MAXPATHLEN];
|
||||
uchar fnamecmp_type;
|
||||
struct file_struct *file;
|
||||
@@ -655,10 +653,8 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
|
||||
|
||||
if (recv_ok > 0) {
|
||||
if (remove_source_files
|
||||
|| (preserve_hard_links && IS_HLINKED(file))) {
|
||||
SIVAL(numbuf, 0, i);
|
||||
send_msg(MSG_SUCCESS, numbuf, 4);
|
||||
}
|
||||
|| (preserve_hard_links && IS_HLINKED(file)))
|
||||
send_msg_int(MSG_SUCCESS, i);
|
||||
} else if (!recv_ok) {
|
||||
enum logcode msgtype = phase || read_batch ? FERROR : FINFO;
|
||||
if (msgtype == FERROR || verbose) {
|
||||
@@ -680,10 +676,8 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
|
||||
"%s: %s failed verification -- update %s%s.\n",
|
||||
errstr, fname, keptstr, redostr);
|
||||
}
|
||||
if (!phase) {
|
||||
SIVAL(numbuf, 0, i);
|
||||
send_msg(MSG_REDO, numbuf, 4);
|
||||
}
|
||||
if (!phase)
|
||||
send_msg_int(MSG_REDO, i);
|
||||
}
|
||||
}
|
||||
make_backups = save_make_backups;
|
||||
|
||||
Reference in New Issue
Block a user