X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/826563dc90345be878a1b6b11dbced121b8332b5..HEAD:/progressmeter.c diff --git a/progressmeter.c b/progressmeter.c index 3cda0906..0f95222d 100644 --- a/progressmeter.c +++ b/progressmeter.c @@ -1,3 +1,4 @@ +/* $OpenBSD: progressmeter.c,v 1.37 2006/08/03 03:34:42 deraadt Exp $ */ /* * Copyright (c) 2003 Nils Nordman. All rights reserved. * @@ -23,7 +24,17 @@ */ #include "includes.h" -RCSID("$OpenBSD: progressmeter.c,v 1.24 2005/06/07 13:25:23 jaredy Exp $"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include #include "progressmeter.h" #include "atomicio.h" @@ -85,8 +96,8 @@ format_rate(char *buf, int size, off_t bytes) bytes = (bytes + 512) / 1024; } snprintf(buf, size, "%3lld.%1lld%c%s", - (int64_t) (bytes + 5) / 100, - (int64_t) (bytes + 5) / 10 % 10, + (long long) (bytes + 5) / 100, + (long long) (bytes + 5) / 10 % 10, unit[i], i ? "B" : " "); } @@ -99,7 +110,7 @@ format_size(char *buf, int size, off_t bytes) for (i = 0; bytes >= 10000 && unit[i] != 'T'; i++) bytes = (bytes + 512) / 1024; snprintf(buf, size, "%4lld%c%s", - (int64_t) bytes, + (long long) bytes, unit[i], i ? "B" : " "); } @@ -154,7 +165,7 @@ refresh_progress_meter(void) len = 0; if (len >= file_len + 1) len = file_len; - for (i = len; i < file_len; i++ ) + for (i = len; i < file_len; i++) buf[i] = ' '; buf[file_len] = '\0'; } @@ -215,6 +226,7 @@ refresh_progress_meter(void) last_update = now; } +/*ARGSUSED*/ static void update_progress_meter(int ignore) { @@ -269,6 +281,7 @@ stop_progress_meter(void) atomicio(vwrite, STDOUT_FILENO, "\n", 1); } +/*ARGSUSED*/ static void sig_winch(int sig) {