Skip to content

Commit

Permalink
Merge pull request #1020 from tleedjarv/fix-1019
Browse files Browse the repository at this point in the history
Give a helpful message when `inotify_init(2)` fails
  • Loading branch information
gdt authored Apr 16, 2024
2 parents 9c8cd36 + 8571008 commit a6b7aa9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/fsmonitor/inotify/watcher.ml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ let event_is_change (_, evl, _, _) = List.exists is_change evl
let event_is_creation (_, evl, _, _) = List.exists is_creation evl
let event_is_deletion (_, evl, _, _) = List.exists is_deletion evl

let st = Lwt_inotify.init ()
let st =
try Lwt_inotify.init () with
| Unix.Unix_error ((EMFILE | EBADF), _, _) ->
Watchercommon.error "unable to start inotify: system limit reached \
(you can do a web search for \"inotify max_user_instances\" \
to understand the reasons and mitigations for this error)"

module IntSet =
Set.Make
Expand Down

0 comments on commit a6b7aa9

Please sign in to comment.