New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the non-compiling utmp case, found on OpenBSD. #57
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh, looks like I did a bad job reviewing #24.
Please add this to the commit message:
Fixes: 47baf7859ec511c4939fbf5b44e292bb60485aac
Good call, updated the commit message. |
For the benefit of readers not in front of an OpenBSD box, will you explain operationally what "fix" you needed because this change was "non-compiling?" You have access to a lot more information that I would myself like to be privileged to--will you amend the commit message explaining what happened rather than what you did? |
The macro did not properly escape all continuation lines. |
Even saying that much is an improvement over the current message, agreed. It also left out a temporary variable. |
By not having build-tested with utmp, I made two easy mistakes: (1) In file included from qbiff.c:3: ./qtmp.h:15:5: error: unknown type name 'substdio' substdio ssutmp; \ ^ ./qtmp.h:16:43: error: expected ';' after top level declarator char bufutmp[sizeof(struct utmp) * 16] ^ ; Mistake: missed a trailing backslash on line 14. Fix: add it. (2) qbiff.c:81:2: error: use of undeclared identifier 'fdutmp'; did you mean 'ssutmp'? UTMP_OPEN; ^ ./qtmp.h:20:33: note: expanded from macro 'UTMP_OPEN' substdio_fdbuf(&ssutmp,read,fdutmp,bufutmp,sizeof(bufutmp)) Mistake: tried to get rid of fdutmp by checking open_read() directly, not realizing fdutmp was still needed on the next line (!). Fix: bring back fdutmp. Fixes: 47baf78
By not having build-tested with utmp, I made two easy mistakes:
(1) In file included from qbiff.c:3:
./qtmp.h:15:5: error: unknown type name 'substdio'
substdio ssutmp;
^
./qtmp.h:16:43: error: expected ';' after top level declarator
char bufutmp[sizeof(struct utmp) * 16]
^
;
Mistake: missed a trailing backslash on line 14.
Fix: add it.
(2) qbiff.c:81:2: error: use of undeclared identifier 'fdutmp'; did you mean 'ssutmp'?
UTMP_OPEN;
^
./qtmp.h:20:33: note: expanded from macro 'UTMP_OPEN'
substdio_fdbuf(&ssutmp,read,fdutmp,bufutmp,sizeof(bufutmp))
Mistake: tried to get rid of fdutmp by checking open_read() directly,
not realizing fdutmp was still needed on the next line (!).
Fix: bring back fdutmp.