Fix duplicate file crash (#2)
This commit is contained in:
parent
1de3af330f
commit
2d846f2e2e
2
Makefile
2
Makefile
@ -11,7 +11,7 @@ DIST := \
|
||||
mtmediasrv.conf
|
||||
|
||||
PROJECT := mtmediasrv
|
||||
VERSION = 4
|
||||
VERSION = 5
|
||||
BUILD = `git describe --tags --always`
|
||||
|
||||
$(PROJECT): main.go
|
||||
|
8
main.go
8
main.go
@ -180,9 +180,13 @@ func collectMedia(l bool, c bool, e map[string]bool, w string) filepath.WalkFunc
|
||||
if l {
|
||||
err := os.Link(path, of)
|
||||
if err != nil {
|
||||
return err
|
||||
if err != os.ErrExist {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err != os.ErrExist {
|
||||
newmedia++
|
||||
}
|
||||
newmedia++
|
||||
} else if c {
|
||||
in, err := os.Open(path)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user