Skip to content

Commit c8e8f79

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 785a100 commit c8e8f79

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
@@ -85,6 +85,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {
8585
Environment* env = Environment::GetCurrent(args);
8686

8787
FSEventWrap* wrap = Unwrap<FSEventWrap>(args.Holder());
88+
CHECK_EQ(wrap->initialized_, false);
8889

8990
if (args.Length() < 1 || !args[0]->IsString()) {
9091
return env->ThrowTypeError("filename must be a valid string");

0 commit comments

Comments
 (0)