From: Wayne Davison Date: Fri, 19 Dec 2003 06:52:02 +0000 (+0000) Subject: Do a small msleep() in the sig_int() handler before shutting down. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/d5a0b483797359517de787c33f518a4c804041f4 Do a small msleep() in the sig_int() handler before shutting down. This kluge allows things like SIGINT to find our children before we go throwing around SIGUSR1's at them. --- diff --git a/rsync.c b/rsync.c index cfee2d03..6c8143c3 100644 --- a/rsync.c +++ b/rsync.c @@ -237,6 +237,15 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st, void sig_int(void) { + /* KLUGE: if the user hits Ctrl-C while ssh is prompting + * for a password, then our cleanup's sending of a SIGUSR1 + * signal to all our children may kill ssh before it has a + * chance to restore the tty settings (i.e. turn echo back + * on). By sleeping for a short time, ssh gets a bigger + * chance to do the right thing. If child processes are + * not ssh waiting for a password, then this tiny delay + * shouldn't hurt anything. */ + msleep(400); exit_cleanup(RERR_SIGNAL); }