diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2016-06-22 13:17:03 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2016-06-29 12:20:59 +0200 |
commit | 57387fa29f130b5fae28b50c935e61665a37f9ff (patch) | |
tree | 7c643ef4ff31d3cbbd6ee047ccfe84770bd2d9df /src | |
parent | 88a87482123c2e9047a247ccb3007d6b0f1900bc (diff) | |
download | node-new-57387fa29f130b5fae28b50c935e61665a37f9ff.tar.gz |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/fs_event_wrap.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index cf9559df9d..2354a1be0c 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -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) |