Skip to content

Commit

Permalink
src: guard against starting fs watcher twice
Browse files Browse the repository at this point in the history
This commit adds a CHECK that verifies that the file event watcher is
not started twice, which would be indicative of a bug in lib/fs.js.

PR-URL: #7374
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
bnoordhuis authored and Fishrock123 committed Jul 5, 2016
1 parent 3b1c19f commit 9945b4e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/fs_event_wrap.cc
Expand Up @@ -88,6 +88,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {

FSEventWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
CHECK_EQ(wrap->initialized_, false);

static const char kErrMsg[] = "filename must be a string or Buffer";
if (args.Length() < 1)
Expand Down

0 comments on commit 9945b4e

Please sign in to comment.