1
0
Fork 0
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:
klauspost 2015-08-12 16:14:56 +02:00
parent b051b0a507
commit db26917bb5
3 changed files with 9 additions and 2 deletions

View file

@ -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")
}

View file

@ -5,10 +5,12 @@
package restic
import (
"os"
"syscall"
)
var mknod = syscall.Mknod
var lchown = os.Lchown
type statUnix syscall.Stat_t

View file

@ -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
}