]> andersk Git - openssh.git/blobdiff - progressmeter.c
- djm@cvs.openbsd.org 2010/01/30 02:54:53
[openssh.git] / progressmeter.c
index 3cda090616f15fd22524ee668d5e57b6a23ccf00..0f95222d24874f760eb14227fdc772cbb7927b8a 100644 (file)
@@ -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.
  *
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: progressmeter.c,v 1.24 2005/06/07 13:25:23 jaredy Exp $");
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/uio.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
 
 #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)
 {
This page took 0.278936 seconds and 4 git commands to generate.