mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 11:58:28 +00:00
lib/fs: harmonize CreateSymlink definitions (fixes #4567)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4632 LGTM: imsodin, AudriusButkevicius
This commit is contained in:
parent
f1c73999be
commit
bbc178ccc4
@ -28,7 +28,7 @@ func (BasicFilesystem) ReadSymlink(path string) (string, error) {
|
||||
return "", errNotSupported
|
||||
}
|
||||
|
||||
func (BasicFilesystem) CreateSymlink(path, target string) error {
|
||||
func (BasicFilesystem) CreateSymlink(target, name string) error {
|
||||
return errNotSupported
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ type errorFilesystem struct {
|
||||
func (fs *errorFilesystem) Chmod(name string, mode FileMode) error { return fs.err }
|
||||
func (fs *errorFilesystem) Chtimes(name string, atime time.Time, mtime time.Time) error { return fs.err }
|
||||
func (fs *errorFilesystem) Create(name string) (File, error) { return nil, fs.err }
|
||||
func (fs *errorFilesystem) CreateSymlink(name, target string) error { return fs.err }
|
||||
func (fs *errorFilesystem) CreateSymlink(target, name string) error { return fs.err }
|
||||
func (fs *errorFilesystem) DirNames(name string) ([]string, error) { return nil, fs.err }
|
||||
func (fs *errorFilesystem) Lstat(name string) (FileInfo, error) { return nil, fs.err }
|
||||
func (fs *errorFilesystem) Mkdir(name string, perm FileMode) error { return fs.err }
|
||||
|
@ -21,7 +21,7 @@ type Filesystem interface {
|
||||
Chmod(name string, mode FileMode) error
|
||||
Chtimes(name string, atime time.Time, mtime time.Time) error
|
||||
Create(name string) (File, error)
|
||||
CreateSymlink(name, target string) error
|
||||
CreateSymlink(target, name string) error
|
||||
DirNames(name string) ([]string, error)
|
||||
Lstat(name string) (FileInfo, error)
|
||||
Mkdir(name string, perm FileMode) error
|
||||
|
@ -44,9 +44,9 @@ func (fs *logFilesystem) Create(name string) (File, error) {
|
||||
return file, err
|
||||
}
|
||||
|
||||
func (fs *logFilesystem) CreateSymlink(name, target string) error {
|
||||
err := fs.Filesystem.CreateSymlink(name, target)
|
||||
l.Debugln(getCaller(), fs.Type(), fs.URI(), "CreateSymlink", name, target, err)
|
||||
func (fs *logFilesystem) CreateSymlink(target, name string) error {
|
||||
err := fs.Filesystem.CreateSymlink(target, name)
|
||||
l.Debugln(getCaller(), fs.Type(), fs.URI(), "CreateSymlink", target, name, err)
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user