From 864ea59da63b4941575e95f7dbbb361f88ee53ef Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 15 Dec 1999 11:04:25 +1100 Subject: - Integrated patchs from Juergen Keil - Fix SIGIO error in scp - Simplify status line printing in scp --- scp.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'scp.c') diff --git a/scp.c b/scp.c index 5a3ec4470..f045d4609 100644 --- a/scp.c +++ b/scp.c @@ -45,7 +45,7 @@ */ #include "includes.h" -RCSID("$Id: scp.c,v 1.12 1999/12/07 04:38:32 damien Exp $"); +RCSID("$Id: scp.c,v 1.13 1999/12/15 00:04:25 damien Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -548,7 +548,7 @@ next: (void) close(fd); if (haderr) (void) write(remout, bp->buf, amt); else { - result = write(remout, bp->buf, amt); + result = atomicio(write, remout, bp->buf, amt); if (result != amt) haderr = result >= 0 ? EIO : errno; statbytes += result; @@ -974,7 +974,7 @@ run_err(const char *fmt,...) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scp.c,v 1.12 1999/12/07 04:38:32 damien Exp $ + * $Id: scp.c,v 1.13 1999/12/15 00:04:25 damien Exp $ */ char * @@ -1145,8 +1145,8 @@ progressmeter(int flag) i++; abbrevsize >>= 10; } - snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %5qd %c%c ", - (quad_t) abbrevsize, prefixes[i], prefixes[i] == ' ' ? ' ' : + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %5d %c%c ", + (int) abbrevsize, prefixes[i], prefixes[i] == ' ' ? ' ' : 'B'); timersub(&now, &lastupdate, &wait); @@ -1184,7 +1184,11 @@ progressmeter(int flag) atomicio(write, fileno(stdout), buf, strlen(buf)); if (flag == -1) { - signal(SIGALRM, (void *) updateprogressmeter); + struct sigaction sa; + sa.sa_handler = updateprogressmeter; + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_RESTART; + sigaction(SIGALRM, &sa, NULL); alarmtimer(1); } else if (flag == 1) { alarmtimer(0); -- cgit v1.2.3