mirror of
https://github.com/octoleo/restic.git
synced 2025-01-23 15:18:31 +00:00
local/sftp backend: Do not seek if offset is 0
This commit is contained in:
parent
6aed9f268b
commit
5d617edbbf
@ -223,9 +223,11 @@ func (b *Local) GetReader(t backend.Type, name string, offset, length uint) (io.
|
|||||||
b.open[filename(b.p, t, name)] = append(open, f)
|
b.open[filename(b.p, t, name)] = append(open, f)
|
||||||
b.mu.Unlock()
|
b.mu.Unlock()
|
||||||
|
|
||||||
_, err = f.Seek(int64(offset), 0)
|
if offset > 0 {
|
||||||
if err != nil {
|
_, err = f.Seek(int64(offset), 0)
|
||||||
return nil, err
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if length == 0 {
|
if length == 0 {
|
||||||
|
@ -336,9 +336,11 @@ func (r *SFTP) GetReader(t backend.Type, name string, offset, length uint) (io.R
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = f.Seek(int64(offset), 0)
|
if offset > 0 {
|
||||||
if err != nil {
|
_, err = f.Seek(int64(offset), 0)
|
||||||
return nil, err
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if length == 0 {
|
if length == 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user