Skip to content

Commit

Permalink
Dropped the EINTR package that is not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Nov 8, 2023
1 parent 9212dba commit 61596f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions client.go
Expand Up @@ -10,7 +10,6 @@ import (
"syscall"
"time"

wunix "github.com/akihirosuda/x-sys-unix-auto-eintr"
"github.com/cespare/xxhash/v2"
"github.com/lkarlslund/gonk"
unix "golang.org/x/sys/unix"
Expand Down Expand Up @@ -142,13 +141,13 @@ func (c *Client) Run(client *rpc.Client) error {
localstat, ok := localfi.Sys().(*syscall.Stat_t)
_, localmtim, _ := getAMtime(*localstat)
if created || ok && localmtim != remotefi.Mtim {
err = wunix.UtimesNanoAt(unix.AT_FDCWD, localpath, []unix.Timespec{unix.Timespec(remotefi.Atim), unix.Timespec(remotefi.Mtim)}, unix.AT_SYMLINK_NOFOLLOW)
err = unix.UtimesNanoAt(unix.AT_FDCWD, localpath, []unix.Timespec{unix.Timespec(remotefi.Atim), unix.Timespec(remotefi.Mtim)}, unix.AT_SYMLINK_NOFOLLOW)
if err != nil {
logger.Error().Msgf("Error setting times for directory %v: %v", localpath, err)
}
}
if created || ok && uint32(localstat.Mode)&^uint32(os.ModePerm) != remotefi.Permissions&^uint32(os.ModePerm) {
err = wunix.Chmod(localpath, remotefi.Permissions)
err = unix.Chmod(localpath, remotefi.Permissions)
if err != nil {
logger.Error().Msgf("Error setting permissions for directory %v: %v", localpath, err)
}
Expand Down Expand Up @@ -475,7 +474,7 @@ func (c *Client) Run(client *rpc.Client) error {
localatim, localmtim, _ := getAMtime(*localstat)
if atim != localatim || mtim != localmtim {
logger.Debug().Msgf("Updating metadata for directory %s", localname)
err = wunix.UtimesNanoAt(unix.AT_FDCWD, localname, []unix.Timespec{unix.Timespec(atim), unix.Timespec(mtim)}, unix.AT_SYMLINK_NOFOLLOW)
err = unix.UtimesNanoAt(unix.AT_FDCWD, localname, []unix.Timespec{unix.Timespec(atim), unix.Timespec(mtim)}, unix.AT_SYMLINK_NOFOLLOW)
if err != nil {
logger.Error().Msgf("Error changing times for directory %s: %v", lookupdirectory.name, err)
}
Expand Down
3 changes: 1 addition & 2 deletions fileinfo.go
Expand Up @@ -7,7 +7,6 @@ import (
"slices"
"syscall"

wunix "github.com/akihirosuda/x-sys-unix-auto-eintr"
"github.com/joshlf/go-acl"
"github.com/pkg/xattr"
unix "golang.org/x/sys/unix"
Expand Down Expand Up @@ -177,7 +176,7 @@ func (fi FileInfo) ApplyChanges(fi2 FileInfo) error {
}
}

err = wunix.UtimesNanoAt(unix.AT_FDCWD, fi.Name, []unix.Timespec{unix.Timespec(fi2.Atim), unix.Timespec(fi2.Mtim)}, unix.AT_SYMLINK_NOFOLLOW)
err = unix.UtimesNanoAt(unix.AT_FDCWD, fi.Name, []unix.Timespec{unix.Timespec(fi2.Atim), unix.Timespec(fi2.Mtim)}, unix.AT_SYMLINK_NOFOLLOW)
if err != nil {
logger.Error().Msgf("Error changing times for %s: %v", fi.Name, err)
}
Expand Down
3 changes: 1 addition & 2 deletions go.mod
@@ -1,9 +1,8 @@
module github.com/lkarlslund/fastsync

go 1.21.1
go 1.21

require (
github.com/akihirosuda/x-sys-unix-auto-eintr v0.0.0-20200303093320-a5fb09464fb2
github.com/cespare/xxhash/v2 v2.2.0
github.com/dustin/go-humanize v1.0.1
github.com/joshlf/go-acl v0.0.0-20200411065538-eae00ae38531
Expand Down

0 comments on commit 61596f3

Please sign in to comment.