Browse Source

fs_event_wrap: update to new libuv api

v0.11.8-release
Timothy J Fontaine 12 years ago
parent
commit
74a664b22f
  1. 22
      src/fs_event_wrap.cc

22
src/fs_event_wrap.cc

@ -108,17 +108,21 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {
String::Utf8Value path(args[0]);
int err = uv_fs_event_init(wrap->env()->event_loop(),
&wrap->handle_,
*path,
OnEvent,
0);
int err = uv_fs_event_init(wrap->env()->event_loop(), &wrap->handle_);
if (err == 0) {
// Check for persistent argument
if (!args[1]->IsTrue()) {
uv_unref(reinterpret_cast<uv_handle_t*>(&wrap->handle_));
}
wrap->initialized_ = true;
err = uv_fs_event_start(&wrap->handle_, OnEvent, *path, 0);
if (err == 0) {
// Check for persistent argument
if (!args[1]->IsTrue()) {
uv_unref(reinterpret_cast<uv_handle_t*>(&wrap->handle_));
}
} else {
FSEventWrap::Close(args);
}
}
args.GetReturnValue().Set(err);

Loading…
Cancel
Save