mirror of
https://github.com/restic/restic.git
synced 2025-03-09 00:00:02 +01:00
EWINDOWS is not present on other OS'es, so use a stub function instead.
This commit is contained in:
parent
b051b0a507
commit
db26917bb5
3 changed files with 9 additions and 2 deletions
4
node.go
4
node.go
|
@ -148,8 +148,8 @@ func (node *Node) CreateAt(path string, repo *repository.Repository) error {
|
|||
func (node Node) restoreMetadata(path string) error {
|
||||
var err error
|
||||
|
||||
err = os.Lchown(path, int(node.UID), int(node.GID))
|
||||
if err != nil && err != syscall.EWINDOWS {
|
||||
err = lchown(path, int(node.UID), int(node.GID))
|
||||
if err != nil {
|
||||
return errors.Annotate(err, "Lchown")
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
package restic
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
var mknod = syscall.Mknod
|
||||
var lchown = os.Lchown
|
||||
|
||||
type statUnix syscall.Stat_t
|
||||
|
||||
|
|
|
@ -20,6 +20,11 @@ var mknod = func(path string, mode uint32, dev int) (err error) {
|
|||
panic("mknod not implemented")
|
||||
}
|
||||
|
||||
// Windows doesn't need lchown
|
||||
var lchown = func(path string, uid int, gid int) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (node Node) restoreSymlinkTimestamps(path string, utimes [2]syscall.Timespec) error {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue