Skip to content

backend, termstatus: fix ioctl calls for 64-bit big-endian platforms#4339

Merged
MichaelEischer merged 2 commits into
restic:masterfrom
greatroar:ioctl
May 26, 2023
Merged

backend, termstatus: fix ioctl calls for 64-bit big-endian platforms#4339
MichaelEischer merged 2 commits into
restic:masterfrom
greatroar:ioctl

Conversation

@greatroar

@greatroar greatroar commented May 25, 2023

Copy link
Copy Markdown
Contributor

What does this PR change? What problem does it solve?

Changes the way we call ioctl to get and set terminal info. The old code didn't work on some 64-bit big-endian platforms, notably linux/s390x.

See commit messages for details. This code already has tests.

Was the change previously discussed in an issue or on the forum?

Fixes #4223.

Checklist

  • I have read the contribution guidelines.
  • I have enabled maintainer edits.
  • I have added tests for all code changes.
  • I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I have run gofmt on the code in all commits.
  • All commit messages are formatted in the same style as the other commits in the repo.
  • I'm done! This pull request is ready for review.

greatroar added 2 commits May 25, 2023 17:20
This function casts its argument to int32 before passing it to the
system call, so that big-endian CPUs read the lower rather than the
upper 32 bits of the pid.

This also gets rid of the last import of "unsafe" in the Unix build.
I changed syscall to x/sys/unix while I was at it, to remove one more
import line. The constants and types there are aliases for their syscall
counterparts.

@MichaelEischer MichaelEischer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks a lot for investigating and solving this mystery!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

restic does not print information when doing backups on s390x

2 participants