mirror of https://github.com/perkeep/perkeep.git
localdisk: fix TODO which resulted in a race/crash.
Change-Id: I7ff0be046c07e5fd33c861afd10b5e725066a033
This commit is contained in:
parent
1d3703f7ef
commit
7b6a26ffeb
pkg/blobserver/localdisk
|
@ -131,7 +131,11 @@ func (ds *DiskStorage) ReceiveBlob(blobRef *blobref.BlobRef, source io.Reader) (
|
|||
}
|
||||
|
||||
func linkAlreadyExists(err error) bool {
|
||||
le, ok := err.(*os.LinkError)
|
||||
// TODO(bradfitz): GO1 not tested; is this ErrExist or syscall.EEXIST?
|
||||
return ok && le.Op == "link" && le.Err == os.ErrExist
|
||||
if os.IsExist(err) {
|
||||
return true
|
||||
}
|
||||
if le, ok := err.(*os.LinkError); ok && os.IsExist(le.Err) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue