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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fromStatT() implementation for NetBSD #41441

Merged
merged 1 commit into from Sep 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions pkg/system/stat_netbsd.go
@@ -0,0 +1,13 @@
package system // import "github.com/docker/docker/pkg/system"

import "syscall"

// fromStatT converts a syscall.Stat_t type to a system.Stat_t type
func fromStatT(s *syscall.Stat_t) (*StatT, error) {
return &StatT{size: s.Size,
mode: uint32(s.Mode),
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this conversion is redundant on netbsd, or did you add on purpose? (if so, perhaps this requires a //nolint:unconvert)

uid: s.Uid,
gid: s.Gid,
rdev: uint64(s.Rdev),
Copy link
Member

Choose a reason for hiding this comment

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

Same question here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replying to both questions here: yeah, both conversions should be useless and can be removed (I've also locally patched them and double-checked them).

@thaJeztah OK to open a new PR to remove them?

Thank you very much @Viandc, @AkihiroSuda and @thaJeztah for the quick reviews and merge!

Copy link
Member

Choose a reason for hiding this comment

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

If you have time to look at cleaning up the duplicates (I think if we keep the conversion in that one to take different cases into account, that's ok)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @thaJeztah, I've just opened #41448 that does that.

mtim: s.Mtimespec}, nil
}