Skip to content

Commit 9945b4e

Browse files
bnoordhuisFishrock123
authored andcommitted
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: #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 3b1c19f commit 9945b4e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)