summaryrefslogtreecommitdiff
path: root/src/fs_event_wrap.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2016-06-22 13:17:03 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2016-06-29 12:20:59 +0200
commit57387fa29f130b5fae28b50c935e61665a37f9ff (patch)
tree7c643ef4ff31d3cbbd6ee047ccfe84770bd2d9df /src/fs_event_wrap.cc
parent88a87482123c2e9047a247ccb3007d6b0f1900bc (diff)
downloadandroid-node-v8-57387fa29f130b5fae28b50c935e61665a37f9ff.tar.gz
android-node-v8-57387fa29f130b5fae28b50c935e61665a37f9ff.tar.bz2
android-node-v8-57387fa29f130b5fae28b50c935e61665a37f9ff.zip
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/fs_event_wrap.cc')
-rw-r--r--src/fs_event_wrap.cc1
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)