Skip to content

Commit

Permalink
force all Nlink cast to uint64 for source compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
puellanivis committed Jul 9, 2021
1 parent 7b1950d commit 66e738e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func runLs(dirname string, dirent os.FileInfo) string {
var uid, gid uint32

if statt, ok := dirent.Sys().(*syscall.Stat_t); ok {
numLinks = statt.Nlink
// The type of Nlink varies form int16 (aix-ppc64) to uint64 (linux-amd64),
// we cast up to uint64 to make all OS/ARCH combos source compatible.
numLinks = uint64(statt.Nlink)
uid = statt.Uid
gid = statt.Gid
}
Expand Down

0 comments on commit 66e738e

Please sign in to comment.