Use same order of parameters as os.Symlink
This commit is contained in:
@@ -817,7 +817,7 @@ func (p *Puller) performFinish(state *sharedPullerState) {
|
||||
// Remove the file, and replace it with a symlink.
|
||||
err = osutil.InWritableDir(func(path string) error {
|
||||
os.Remove(path)
|
||||
return symlinks.Create(path, string(content), state.file.Flags)
|
||||
return symlinks.Create(string(content), path, state.file.Flags)
|
||||
}, state.realName)
|
||||
if err != nil {
|
||||
l.Warnln("puller: final: creating symlink:", err)
|
||||
|
||||
@@ -48,7 +48,7 @@ func IsSymlink(path string) (bool, error) {
|
||||
return lstat.Mode()&os.ModeSymlink != 0, nil
|
||||
}
|
||||
|
||||
func Create(source, target string, flags uint32) error {
|
||||
func Create(target, source string, flags uint32) error {
|
||||
return os.Symlink(osutil.NativeFilename(target), source)
|
||||
}
|
||||
|
||||
@@ -77,6 +77,6 @@ func ChangeType(path string, flags uint32) error {
|
||||
// It should be a symlink as well hence no need to change permissions
|
||||
// on the file.
|
||||
os.Remove(path)
|
||||
return Create(path, target, flags)
|
||||
return Create(target, path, flags)
|
||||
}, path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user