Skip to content

Commit

Permalink
readdcw: do not panic on invalid/zero actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawel Knap committed Dec 2, 2020
1 parent 9c77608 commit 80351c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions watcher_readdcw.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package notify

import (
"errors"
"fmt"
"runtime"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -588,7 +587,9 @@ func decode(filter, action uint32) (Event, Event) {
case syscall.FILE_ACTION_RENAMED_NEW_NAME:
return gensys(filter, Rename, FileActionRenamedNewName)
}
panic(fmt.Sprintln(`notify: cannot decode internal mask:`, action))
dbgprintf("cannot decode internal mask: %d", action)

return 0, 0
}

// gensys decides whether the Windows action, system-independent event or both
Expand Down

0 comments on commit 80351c6

Please sign in to comment.