use floating point for printout of stats - this wrks on machines
authorAndrew Tridgell <tridge@samba.org>
Wed, 6 May 1998 06:07:06 +0000 (06:07 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 6 May 1998 06:07:06 +0000 (06:07 +0000)
without long long but with a 64 bit off_t

configure.in
main.c
syscall.c

index 6ffd78e..511620a 100644 (file)
@@ -52,7 +52,7 @@ echo no)
 
 echo $ac_n "checking for long long ... $ac_c"
 AC_TRY_RUN([#include <stdio.h>
-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 c0e15d6..dc9a230 100644 (file)
--- 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));
 }
 
 
index 103c002..10b32f8 100644 (file)
--- 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)
 {