printrecord(&as,filename);
}
} else {
- long seekdist= -(long)sizeof(as);
r= fseek(file,0,SEEK_END); if (r) { perror(filename); exit(8); }
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 (;;) {
r= fseek(file,pos,SEEK_SET); if (r==-1) { perror(filename); exit(8); }
r= fread(&as,1,sizeof(as),file); if (r!=sizeof(as)) { perror(filename); exit(8); }
printrecord(&as,filename);
- seekdist= -2*(long)sizeof(as);
}
}
if (ferror(file) || fclose(file)) { perror(filename); exit(8); }
}
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);