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

Use Mkdev, Major and Minor functions from golang.org/x/sys/unix #1580

Merged
merged 3 commits into from
Oct 2, 2017

Conversation

tklauser
Copy link
Contributor

@tklauser tklauser commented Oct 2, 2017

Re-vendor golang.org/x/sys/unix in order to get the Mkdev, Major and Minor functions for every supported OS. Use these to get the proper device number encodings on all Unix-like OSes and remove the local Linux-specific versions of these functions.

Also remove usage of SIGUNUSED after the golang.org/x/sys update as it was removed upstream.

Update golang.org/x/sys to 314a259e304ff91bd6985da2a7149bbf91237993

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
The SIGUNUSED constant was removed from golang.org/x/sys/unix in
https://go-review.googlesource.com/61771 as it is also removed from the
respective glibc headers.

This means the command

  ctr tasks kill SIGUNUSED ...

will no longer work. However, the same effect can be achieved with

  ctr tasks kill SIGSYS ...

as SIGSYS has the same value as SIGUNUSED used to have.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Now that golang.org/x/sys/unix provides the Mkdev, Major and Minor
functions for every OS, use them instead of the locally defined version
which uses the Linux specific device major/minor encoding.

This also means that the device number should now be properly encoded on
e.g. Darwin, FreeBSD or Solaris.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
@codecov-io
Copy link

Codecov Report

Merging #1580 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1580   +/-   ##
=======================================
  Coverage   42.36%   42.36%           
=======================================
  Files          24       24           
  Lines        3368     3368           
=======================================
  Hits         1427     1427           
  Misses       1612     1612           
  Partials      329      329

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 16bf823...f01b139. Read the comment docs.

@crosbymichael
Copy link
Member

LGTM

Copy link
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

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

LGTM

@mlaventure mlaventure merged commit 2416559 into containerd:master Oct 2, 2017
@tklauser tklauser deleted the unix-mkdev-major-minor branch October 2, 2017 15:06
@stevvooe
Copy link
Member

stevvooe commented Oct 2, 2017

Do we have to update this in continuity? https://github.com/containerd/continuity/tree/master/devices

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.

5 participants