From efb2f6bf626c4379065431bc207b47a4b824a7f3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 6 May 1998 06:07:06 +0000 Subject: [PATCH] use floating point for printout of stats - this wrks on machines without long long but with a 64 bit off_t --- configure.in | 2 +- main.c | 15 ++++----------- syscall.c | 2 ++ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/configure.in b/configure.in index 6ffd78eb..511620af 100644 --- a/configure.in +++ b/configure.in @@ -52,7 +52,7 @@ echo no) echo $ac_n "checking for long long ... $ac_c" AC_TRY_RUN([#include -main() { long long x = 1000000; char b[20]; x *= x; sprintf(b,"%lld", x); exit(strcmp("1000000000000", b) == 0? 0: 1); }], +main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }], echo yes;AC_DEFINE(HAVE_LONGLONG), echo no) diff --git a/main.c b/main.c index c0e15d61..dc9a230b 100644 --- a/main.c +++ b/main.c @@ -91,17 +91,10 @@ static void report(int f) tsize = read_longint(f); } -#if HAVE_LONGLONG - printf("wrote %lld bytes read %lld bytes %.2f bytes/sec\n", - (long long)out,(long long)in,(in+out)/(0.5 + (t-starttime))); - printf("total size is %lld speedup is %.2f\n", - (long long)tsize,(1.0*tsize)/(in+out)); -#else - printf("wrote %ld bytes read %ld bytes %.2f bytes/sec\n", - (long)out,(long)in,(in+out)/(0.5 + (t-starttime))); - printf("total size is %ld speedup is %.2f\n", - (long)tsize,(1.0*tsize)/(in+out)); -#endif + printf("wrote %.0f bytes read %.0f bytes %.2f bytes/sec\n", + (double)out,(double)in,(in+out)/(0.5 + (t-starttime))); + printf("total size is %.0f speedup is %.2f\n", + (double)tsize,(1.0*tsize)/(in+out)); } diff --git a/syscall.c b/syscall.c index 103c002f..10b32f84 100644 --- a/syscall.c +++ b/syscall.c @@ -105,6 +105,7 @@ int do_stat(const char *fname, STRUCT_STAT *st) #endif } +#if SUPPORT_LINKS int do_lstat(const char *fname, STRUCT_STAT *st) { #if HAVE_OFF64_T @@ -113,6 +114,7 @@ int do_lstat(const char *fname, STRUCT_STAT *st) return lstat(fname, st); #endif } +#endif int do_fstat(int fd, STRUCT_STAT *st) { -- 2.34.1