chiark / gitweb /
Use different struct acct, and different headers, on different platforms.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Oct 2014 23:45:05 +0000 (23:45 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Oct 2014 23:45:05 +0000 (23:45 +0000)
cprogs/acctdump.c
debian/changelog

index 8745f0810e55cbacec8d4299ab54be710693a2ff..566840294c954ca3c2a6e3d8816c470d512f1905 100644 (file)
 #include <sys/stat.h>
 
 typedef unsigned long long u64;
 #include <sys/stat.h>
 
 typedef unsigned long long u64;
+
+
+/* Sadly this thing is not very portable */
+
+#if defined(__linux__)
+
+#include <sys/types.h>
 #include <sys/acct.h>
 #include <sys/acct.h>
+
 typedef struct acct_v3 struct_acct;
 
 typedef struct acct_v3 struct_acct;
 
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/acct.h>
+
+typedef struct acctv2 struct_acct;
+
+#else
+
+#error Do not know what struct_acct to use on this platform
+
+#endif
+
+
 #include "myopt.h"
 
 static int forwards, nobanner, usestdin, raw, usages;
 #include "myopt.h"
 
 static int forwards, nobanner, usestdin, raw, usages;
index 99e599996adf3fc9aee73ac5364569d727b8f6f7..e140080a20e39f968e8b17572952a96e0a96c308 100644 (file)
@@ -2,6 +2,8 @@ chiark-utils (4.4.1) unstable; urgency=low
 
   Portability fixes for acctdump:
   * Do not build on platforms with no <sys/acct.h>
 
   Portability fixes for acctdump:
   * Do not build on platforms with no <sys/acct.h>
+  * Use different struct acct, and different headers, on different
+    platforms.
 
  --
 
 
  --