chiark / gitweb /
Tolerate lack of ac_minflt and ac_majflt (and use %lu as is right).
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Oct 2014 23:48:04 +0000 (23:48 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Oct 2014 23:48:04 +0000 (23:48 +0000)
cprogs/acctdump.c
debian/changelog

index 7139922..35acfb3 100644 (file)
@@ -43,6 +43,7 @@ typedef unsigned long long u64;
 
 typedef struct acct_v3 struct_acct;
 #define HAVE_AC_EXITCODE
+#define HAVE_AC_FLT
 
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 
@@ -177,8 +178,11 @@ static void printbanner(void) {
          , stdout);
   }
   if (usages) {
-    fputs("  user time   sys time  elap time   minflt   maxflt",
-         stdout);
+    fputs("  user time   sys time  elap time "
+#ifdef HAVE_AC_FLT
+         "  minflt   maxflt"
+#endif
+         , stdout);
   }
   putchar('\n');
   checkstdout();
@@ -289,12 +293,15 @@ static void printrecord(const struct_acct *as, const char *filename) {
 #endif /*HAVE_AC_EXITCODE*/
 
   if (usages) {
-    printf(" %10lu %10lu %10lu %8ld %8ld",
+    printf(" %10lu %10lu %10lu",
           (unsigned long)as->ac_utime,
           (unsigned long)as->ac_stime,
-          (unsigned long)as->ac_etime,
+          (unsigned long)as->ac_etime);
+#ifdef HAVE_AC_FLT
+    printf(" %8lu %8lu",
           (unsigned long)as->ac_minflt,
           (unsigned long)as->ac_majflt);
+#endif
   }
   putchar('\n');
 
index 9350f09..644c984 100644 (file)
@@ -5,6 +5,7 @@ chiark-utils (4.4.1) unstable; urgency=low
   * Use different struct acct, and different headers, on different
     platforms.
   * Tolerate lack of ac_exitcode.
+  * Tolerate lack of ac_minflt and ac_majflt (and use %lu as is right).
 
  --