Skip to content
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

Merged
merged 2 commits into from Aug 6, 2019
Merged

Conversation

schmonz
Copy link
Member

@schmonz schmonz commented Aug 6, 2019

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.

@schmonz schmonz added this to the 1.07 milestone Aug 6, 2019
@schmonz schmonz added the build label Aug 6, 2019
Copy link
Member

@DerDakon DerDakon left a 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

@schmonz
Copy link
Member Author

schmonz commented Aug 6, 2019

Good call, updated the commit message.

@DerDakon DerDakon self-requested a review August 6, 2019 12:47
@alanpost
Copy link
Contributor

alanpost commented Aug 6, 2019

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?

@DerDakon
Copy link
Member

DerDakon commented Aug 6, 2019

The macro did not properly escape all continuation lines.

@alanpost
Copy link
Contributor

alanpost commented Aug 6, 2019

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
.travis.yml Outdated Show resolved Hide resolved
@alanpost alanpost merged commit 75b8eb4 into master Aug 6, 2019
@schmonz schmonz deleted the utmpx-bis branch August 6, 2019 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants