diff options
Diffstat (limited to 'net/rsync/files/extrapatch-siginfo')
-rw-r--r-- | net/rsync/files/extrapatch-siginfo | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/net/rsync/files/extrapatch-siginfo b/net/rsync/files/extrapatch-siginfo new file mode 100644 index 000000000000..369e093c473d --- /dev/null +++ b/net/rsync/files/extrapatch-siginfo @@ -0,0 +1,62 @@ +diff --git a/main.c b/main.c +index 4613c96..3d47f3a 100644 +--- a/main.c ++++ b/main.c +@@ -81,6 +81,7 @@ + extern unsigned int module_dirlen; + extern BOOL flist_receiving_enabled; + extern BOOL shutting_down; ++extern BOOL want_progress_now; + extern int basis_dir_cnt; + extern struct stats stats; + extern char *stdout_format; +@@ -1447,6 +1448,15 @@ + _exit(0); + } + ++#ifdef SIGINFO ++static RETSIGTYPE siginfo_handler(UNUSED(int val)) ++{ ++ ++ if (!am_server) ++ want_progress_now = True; ++} ++#endif ++ + RETSIGTYPE remember_children(UNUSED(int val)) + { + #ifdef WNOHANG +@@ -1546,6 +1556,9 @@ + 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(); +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); |