Skip to content

Commit

Permalink
v6: properly handle os.IsExist().
Browse files Browse the repository at this point in the history
  • Loading branch information
sofar committed Jan 3, 2019
1 parent 2d846f2 commit 8b7a764
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 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 = 5
VERSION = 6
BUILD = `git describe --tags --always`

$(PROJECT): main.go
Expand Down
9 changes: 4 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,12 @@ func collectMedia(l bool, c bool, e map[string]bool, w string) filepath.WalkFunc
if l {
err := os.Link(path, of)
if err != nil {
if err != os.ErrExist {
return err
if os.IsExist(err) {
return nil
}
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 8b7a764

Please sign in to comment.