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
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ import (
|
|||
func setNewFileMode(f string, fi os.FileInfo) error {
|
||||
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)
|
||||
if err == syscall.ENOTSUP {
|
||||
if perr, ok := err.(*os.PathError); ok && perr.Err == syscall.ENOTSUP {
|
||||
err = nil
|
||||
}
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue