ports/net/rsync/files/patch-siginfo
2015-12-22 10:09:19 +00:00

63 lines
1.7 KiB
Text

diff --git a/main.c b/main.c
index 4613c96..3d47f3a 100644
--- a/main.c
+++ b/main.c
@@ -76,6 +76,7 @@ extern size_t bwlimit_writemax;
extern unsigned int module_dirlen;
extern BOOL flist_receiving_enabled;
extern BOOL shutting_down;
+extern BOOL want_progress_now;
extern int backup_dir_len;
extern int basis_dir_cnt;
extern struct stats stats;
@@ -1439,6 +1440,15 @@ static void sigusr2_handler(UNUSED(int val))
_exit(0);
}
+#ifdef SIGINFO
+static void siginfo_handler(UNUSED(int val))
+{
+
+ if (!am_server)
+ want_progress_now = True;
+}
+#endif
+
void remember_children(UNUSED(int val))
{
#ifdef WNOHANG
@@ -1538,6 +1548,9 @@ int main(int argc,char *argv[])
SIGACTMASK(SIGABRT, rsync_panic_handler);
SIGACTMASK(SIGBUS, rsync_panic_handler);
#endif
+#ifdef SIGINFO
+ SIGACTMASK(SIGINFO, siginfo_handler);
+#endif
starttime = time(NULL);
our_uid = MY_UID();
diff --git a/receiver.c b/receiver.c
index 4ea4c09..1c255ef 100644
--- a/receiver.c
+++ b/receiver.c
@@ -62,6 +62,8 @@ extern char sender_file_sum[MAX_DIGEST_LEN];
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern filter_rule_list daemon_filter_list;
+BOOL want_progress_now;
+
static struct bitbag *delayed_bits = NULL;
static int phase = 0, redoing = 0;
static flist_ndx_list batch_redo_list;
@@ -302,6 +304,11 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
while ((i = recv_token(f_in, &data)) != 0) {
if (INFO_GTE(PROGRESS, 1))
show_progress(offset, total_size);
+ else if (want_progress_now) {
+ rprintf(FINFO, "%s\n", fname);
+ end_progress(offset);
+ }
+ want_progress_now = False;
if (allowed_lull)
maybe_send_keepalive(time(NULL), MSK_ALLOW_FLUSH | MSK_ACTIVE_RECEIVER);