chiark / gitweb /
acctdump: Actually, we didn't need acct.h at all
[chiark-utils.git] / cprogs / acctdump.c
index 133104938fabd6d4b7d3b5ea7d872bf59ac8c0aa..4d3877f76ac5d72f0408553a42ff7aa8d3ca94c2 100644 (file)
@@ -32,8 +32,7 @@
 #include <sys/stat.h>
 
 typedef unsigned long long u64;
-#include "acct.h"
-/*#include <sys/acct.h>*/
+#include <sys/acct.h>
 typedef struct acct_v3 struct_acct;
 
 #include "myopt.h"
@@ -293,7 +292,7 @@ static void processfile(FILE *file, const char *filename) {
     pos= ftell(file); if (pos==-1) { perror(filename); exit(8); }
     if (pos % sizeof(as)) { 
       fprintf(stderr, "%s: File size is not an integral number "
-             "of accounting records", filename);
+             "of accounting records\n", filename);
       exit(8);
     }
     for (;;) {
@@ -315,15 +314,12 @@ static void processnamedfile(const char *filename) {
 }
 
 int main(int argc, const char *const *argv) {
-union { struct_acct ac; char c[1]; } xu;
   myopt(&argv,cmdinfos);
   if (!nobanner) printbanner();
-fprintf(stdout,"s=%d %d\n",(int)sizeof(struct_acct),
-       (int)((char*)&xu.ac.ac_comm - xu.c));
   if (usestdin) {
     processfile(stdin,"<standard input>");
   } else if (!*argv) {
-    processnamedfile("/var/account/pacct");
+    processnamedfile("/var/log/account/pacct");
   } else {
     while (*argv) {
       processnamedfile(*argv);