Skip to content

Commit

Permalink
Fix duplicate file crash (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
sofar committed Dec 30, 2018
1 parent 1de3af3 commit 2d846f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DIST := \
mtmediasrv.conf

PROJECT := mtmediasrv
VERSION = 4
VERSION = 5
BUILD = `git describe --tags --always`

$(PROJECT): main.go
Expand Down
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2d846f2

Please sign in to comment.