From 66e738ef23fce6d3ff3ae98fdf78265c622dfccf Mon Sep 17 00:00:00 2001 From: Cassondra Foesch Date: Fri, 9 Jul 2021 11:32:12 +0000 Subject: [PATCH] force all Nlink cast to uint64 for source compatibility --- server_unix.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server_unix.go b/server_unix.go index 07f84d17..a7b7617c 100644 --- a/server_unix.go +++ b/server_unix.go @@ -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 }