Skip to content

Commit 57387fa

Browse files
committed
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: nodejs#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>
1 parent 88a8748 commit 57387fa

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/fs_event_wrap.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {
8888

8989
FSEventWrap* wrap;
9090
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
91+
CHECK_EQ(wrap->initialized_, false);
9192

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

0 commit comments

Comments
 (0)