Skip to content

Commit

Permalink
[linux][disk]: fix Rdev cast
Browse files Browse the repository at this point in the history
  • Loading branch information
shirou committed Jan 1, 2024
1 parent df3c7bd commit ce11e9c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions disk/disk_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,8 @@ func SerialNumberWithContext(ctx context.Context, name string) (string, error) {
if err := unix.Stat(name, &stat); err != nil {
return "", err
}
major := unix.Major(stat.Rdev)
minor := unix.Minor(stat.Rdev)
major := unix.Major(uint64(stat.Rdev))
minor := unix.Minor(uint64(stat.Rdev))

sserial, _ := udevData(ctx, major, minor, "E:ID_SERIAL")
if sserial != "" {
Expand Down Expand Up @@ -541,8 +541,8 @@ func LabelWithContext(ctx context.Context, name string) (string, error) {
if err := unix.Stat(common.HostDevWithContext(ctx, name), &stat); err != nil {
return "", err
}
major := unix.Major(stat.Rdev)
minor := unix.Minor(stat.Rdev)
major := unix.Major(uint64(stat.Rdev))
minor := unix.Minor(uint64(stat.Rdev))

label, err := udevData(ctx, major, minor, "E:ID_FS_LABEL")
if err != nil {
Expand Down

0 comments on commit ce11e9c

Please sign in to comment.