Browse Source

src: guard against starting fs watcher twice

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: https://github.com/nodejs/node/pull/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>
v7.x
Ben Noordhuis 9 years ago
parent
commit
57387fa29f
  1. 1
      src/fs_event_wrap.cc

1
src/fs_event_wrap.cc

@ -88,6 +88,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {
FSEventWrap* wrap; FSEventWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
CHECK_EQ(wrap->initialized_, false);
static const char kErrMsg[] = "filename must be a string or Buffer"; static const char kErrMsg[] = "filename must be a string or Buffer";
if (args.Length() < 1) if (args.Length() < 1)

Loading…
Cancel
Save