Seperate different utmp structure definitions (backport #40541) #40591
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The amd64 and arm64 utmp structures differ. The PR separates the definitions of the those structures, separates the test files, and separates the test data files.
The utmp structure is defined like this:
The
#define
phrase,#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
is true amd64, but not for arm64. This makes the structure slightly larger for arm64. The structure definitions are separated out into os/architecture files. Likewise, thelogin_test.go
has been renamed tologin_linux_amd64_test.go
. A new test file for arm64 utmp/btmp files was added and namedlogin_linux_arm64_test.go
. Finally, new utmp and btmp files generated on an arm64 system were added.Checklist
I have commented my code, particularly in hard-to-understand areasI have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
This is an automatic backport of pull request #40541 done by [Mergify](https://mergify.com).