Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2019-06-12 15:58:10 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2019-06-12 16:04:04 +0300
commite713baaa3e6f0bec5087c06243e9a84c2b69cfdf (patch)
treec4046adf56cc1c43e7c4d616c52641dbbb2b5e11
parent0dcb5c579e63754f557aef91a4fa7a00e5b8b127 (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.yml3
-rw-r--r--internal/helper/fstype/detect_linux.go4
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
}