From: Sergey Matveev Date: Fri, 8 Jan 2021 12:44:10 +0000 (+0300) Subject: Fix workability under GNU/Linux and other systems because of different syscall X-Git-Tag: v0.8.0^0 X-Git-Url: http://www.git.cypherpunks.ru/?p=goredo.git;a=commitdiff_plain;h=14398260feaf14dac68b9bdb1c810ccba7d1e768 Fix workability under GNU/Linux and other systems because of different syscall --- diff --git a/README b/README index beb6688..a35eab3 100644 --- a/README +++ b/README @@ -16,6 +16,8 @@ goredo is free software: see the file COPYING for copying conditions. Home page: http://www.goredo.cypherpunks.ru/ INSTALL *goredo-install* + +Hopefully it should work on all POSIX systems. > $ go get go.cypherpunks.ru/goredo $ goredo -symlinks @@ -28,7 +30,7 @@ problems with the authenticity on your side, then build it manually: > $ git clone git://git.cypherpunks.ru/goredo.git $ cd goredo - $ git tag -v v0.7.1 + $ git tag -v v0.8.0 $ git clone git://git.cypherpunks.ru/gorecfile.git $ ( cd gorecfile ; git tag -v v0.4.0 ) $ echo "replace go.cypherpunks.ru/recfile => `pwd`/gorecfile" >> go.mod diff --git a/dep.go b/dep.go index a362a38..38d8bb7 100644 --- a/dep.go +++ b/dep.go @@ -28,10 +28,10 @@ import ( "os" "path" "strings" - "syscall" "go.cypherpunks.ru/recfile" "golang.org/x/crypto/blake2b" + "golang.org/x/sys/unix" ) func recfileWrite(fdDep *os.File, fields ...recfile.Field) error { @@ -74,12 +74,11 @@ func stamp(fdDep, src *os.File) error { } func fileCtime(fd *os.File) (string, error) { - fi, err := fd.Stat() - if err != nil { + var stat unix.Stat_t + if err := unix.Fstat(int(fd.Fd()), &stat); err != nil { return "", err } - stat := fi.Sys().(*syscall.Stat_t) - sec, nsec := stat.Ctimespec.Unix() + sec, nsec := stat.Ctim.Unix() return fmt.Sprintf("%d.%d", sec, nsec), nil } diff --git a/go.mod b/go.mod index eb7170a..f6c12a9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module go.cypherpunks.ru/goredo -go 1.14 +go 1.12 require ( go.cypherpunks.ru/recfile v0.4.0 diff --git a/usage.go b/usage.go index 9d37da3..8f0b0e5 100644 --- a/usage.go +++ b/usage.go @@ -26,7 +26,7 @@ import ( ) const ( - Version = "0.7.1" + Version = "0.8.0" Warranty = `This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.