From 94482cb2c97aa215f83940643c5d4c0933727dcb Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 21 Feb 2026 13:38:02 +0800 Subject: *: Modernize and lint; add CI --- objectstore/packed/pack.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'objectstore/packed/pack.go') diff --git a/objectstore/packed/pack.go b/objectstore/packed/pack.go index 46eca524..00950159 100644 --- a/objectstore/packed/pack.go +++ b/objectstore/packed/pack.go @@ -5,6 +5,8 @@ import ( "fmt" "os" "syscall" + + "codeberg.org/lindenii/furgit/internal/intconv" ) const packSignature = 0x5041434b @@ -27,7 +29,11 @@ func openPackFile(name string, file *os.File, size int64) (*packFile, error) { if size > int64(int(^uint(0)>>1)) { return nil, fmt.Errorf("objectstore/packed: pack %q has unsupported size", name) } - data, err := syscall.Mmap(int(file.Fd()), 0, int(size), syscall.PROT_READ, syscall.MAP_PRIVATE) + fd, err := intconv.UintptrToInt(file.Fd()) + if err != nil { + return nil, err + } + data, err := syscall.Mmap(fd, 0, int(size), syscall.PROT_READ, syscall.MAP_PRIVATE) if err != nil { return nil, err } -- cgit v1.3.1-10-gc9f91