+/* $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"
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" : " ");
}
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" : " ");
}
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';
}
last_update = now;
}
+/*ARGSUSED*/
static void
update_progress_meter(int ignore)
{
atomicio(vwrite, STDOUT_FILENO, "\n", 1);
}
+/*ARGSUSED*/
static void
sig_winch(int sig)
{