diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-06-12 15:58:10 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-06-12 16:04:04 +0300 |
commit | e713baaa3e6f0bec5087c06243e9a84c2b69cfdf (patch) | |
tree | c4046adf56cc1c43e7c4d616c52641dbbb2b5e11 | |
parent | 0dcb5c579e63754f557aef91a4fa7a00e5b8b127 (diff) |
Cast FsStat syscall to int64
On for example ARMv6 this syscall will return an int32 instead of an
int64. By explicitly casting this would still work as Golangs type
inferencer will work in both occasions.
Closes https://gitlab.com/gitlab-org/gitaly/issues/1726
-rw-r--r-- | changelogs/unreleased/zj-int64-fsstat.yml | 3 | ||||
-rw-r--r-- | internal/helper/fstype/detect_linux.go | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/changelogs/unreleased/zj-int64-fsstat.yml b/changelogs/unreleased/zj-int64-fsstat.yml new file mode 100644 index 000000000..9ca699352 --- /dev/null +++ b/changelogs/unreleased/zj-int64-fsstat.yml @@ -0,0 +1,3 @@ +title: Cast FsStat syscall to int64 +type: fixed +merge_request: 1306 diff --git a/internal/helper/fstype/detect_linux.go b/internal/helper/fstype/detect_linux.go index cf9322749..98c7b1b8a 100644 --- a/internal/helper/fstype/detect_linux.go +++ b/internal/helper/fstype/detect_linux.go @@ -8,5 +8,7 @@ func statFileSystemType(path string) (int64, error) { return 0, err } - return stat.Type, nil + // This explicit cast to int64 is required for systems where the syscall + // returns an int32 instead. + return int64(stat.Type), nil } |