The branch, master has been updated
       via  0d34fbd Make daemon listener exit w/code 0 on SIGTERM.
      from  d51a3ad Set the modtime to 0 on a partial file. Fixes debian bug 
624826.

;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0d34fbdf5afa4c55f94d0a82ead5b8ace26f3406
Author: Wayne Davison <way...@samba.org>
Date:   Sat Jun 16 10:30:46 2012 -0700

    Make daemon listener exit w/code 0 on SIGTERM.

-----------------------------------------------------------------------

Summary of changes:
 rsync.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/rsync.c b/rsync.c
index c42d553..93f6b98 100644
--- a/rsync.c
+++ b/rsync.c
@@ -35,6 +35,7 @@ extern int preserve_executability;
 extern int preserve_times;
 extern int am_root;
 extern int am_server;
+extern int am_daemon;
 extern int am_sender;
 extern int am_receiver;
 extern int am_generator;
@@ -599,7 +600,7 @@ int set_file_attrs(const char *fname, struct file_struct 
*file, stat_x *sxp,
        return updated;
 }
 
-RETSIGTYPE sig_int(UNUSED(int val))
+RETSIGTYPE sig_int(int sig_num)
 {
        /* KLUGE: if the user hits Ctrl-C while ssh is prompting
         * for a password, then our cleanup's sending of a SIGUSR1
@@ -610,6 +611,10 @@ RETSIGTYPE sig_int(UNUSED(int val))
         * not ssh waiting for a password, then this tiny delay
         * shouldn't hurt anything. */
        msleep(400);
+       /* If we're an rsync daemon listener (not a daemon server),
+        * we'll exit with status 0 if we received SIGTERM. */
+       if (am_daemon && !am_server && sig_num == SIGTERM)
+               exit_cleanup(0);
        exit_cleanup(RERR_SIGNAL);
 }
 


-- 
The rsync repository.
_______________________________________________
rsync-cvs mailing list
rsync-cvs@lists.samba.org
https://lists.samba.org/mailman/listinfo/rsync-cvs

Reply via email to