summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-04-16 04:47:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-04-16 04:47:44 +0000
commitd8e21073f8852de639667b32701702485426f00b (patch)
tree9f8c13f442bee19c926506848a1891644b5a39c0
parent5267447126d67bc9309f75e5244761c25254253b (diff)
after completion, replace the progress bar ETA counter with a final elapsed time; my idea, aaron wrote the patch
-rw-r--r--usr.bin/ssh/scp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c
index 8fb24964df2..03618f634ef 100644
--- a/usr.bin/ssh/scp.c
+++ b/usr.bin/ssh/scp.c
@@ -45,7 +45,7 @@
*/
#include "includes.h"
-RCSID("$Id: scp.c,v 1.27 2000/04/14 10:30:32 markus Exp $");
+RCSID("$Id: scp.c,v 1.28 2000/04/16 04:47:43 deraadt Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -1006,7 +1006,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.27 2000/04/14 10:30:32 markus Exp $
+ * $Id: scp.c,v 1.28 2000/04/16 04:47:43 deraadt Exp $
*/
char *
@@ -1209,7 +1209,12 @@ progressmeter(int flag)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
" - stalled -");
} else {
- remaining = (int) (totalbytes / (statbytes / elapsed) - elapsed);
+ if (flag != 1)
+ remaining =
+ (int)(totalbytes / (statbytes / elapsed) - elapsed);
+ else
+ remaining = elapsed;
+
i = remaining / 3600;
if (i)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
@@ -1219,7 +1224,8 @@ progressmeter(int flag)
" ");
i = remaining % 3600;
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
- "%02d:%02d ETA", i / 60, i % 60);
+ "%02d:%02d%s", i / 60, i % 60,
+ (flag != 1) ? " ETA" : " ");
}
atomicio(write, fileno(stdout), buf, strlen(buf));