mirror of https://github.com/restic/restic.git
Test error for os.PathError
See https://github.com/restic/restic/issues/1079#issuecomment-315177469 for details.
This commit is contained in:
parent
357e2e404a
commit
1d2045cb61
|
@ -12,7 +12,7 @@ import (
|
||||||
func setNewFileMode(f string, fi os.FileInfo) error {
|
func setNewFileMode(f string, fi os.FileInfo) error {
|
||||||
err := fs.Chmod(f, fi.Mode()&os.FileMode(^uint32(0222)))
|
err := fs.Chmod(f, fi.Mode()&os.FileMode(^uint32(0222)))
|
||||||
// ignore the error if the FS does not support setting this mode (e.g. CIFS with gvfs on Linux)
|
// ignore the error if the FS does not support setting this mode (e.g. CIFS with gvfs on Linux)
|
||||||
if err == syscall.ENOTSUP {
|
if perr, ok := err.(*os.PathError); ok && perr.Err == syscall.ENOTSUP {
|
||||||
err = nil
|
err = nil
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue