diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-06-16 22:41:37 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-06-21 03:05:18 +0200 |
commit | f0ce98441ff7315e6a6c268dabcec58fc37da926 (patch) | |
tree | 9d0f41c17dbf55b42796cac9d725ba42c88c90e1 /src/node_stat_watcher.h | |
parent | d98a8578d62cd1b35574269dc028a0c8c34ef25b (diff) | |
download | node-new-f0ce98441ff7315e6a6c268dabcec58fc37da926.tar.gz |
fs: make fs.watchFile() work on windows
Diffstat (limited to 'src/node_stat_watcher.h')
-rw-r--r-- | src/node_stat_watcher.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/node_stat_watcher.h b/src/node_stat_watcher.h index 2b2d1331de..5b09d2f04c 100644 --- a/src/node_stat_watcher.h +++ b/src/node_stat_watcher.h @@ -23,7 +23,7 @@ #define NODE_STAT_WATCHER_H_ #include "node.h" -#include "uv-private/ev.h" +#include "uv.h" namespace node { @@ -36,14 +36,11 @@ class StatWatcher : ObjectWrap { StatWatcher() : ObjectWrap() { persistent_ = false; - path_ = NULL; - ev_init(&watcher_, StatWatcher::Callback); - watcher_.data = this; + uv_fs_poll_init(uv_default_loop(), &watcher_); } ~StatWatcher() { Stop(); - assert(path_ == NULL); } static v8::Handle<v8::Value> New(const v8::Arguments& args); @@ -51,13 +48,15 @@ class StatWatcher : ObjectWrap { static v8::Handle<v8::Value> Stop(const v8::Arguments& args); private: - static void Callback(EV_P_ ev_stat *watcher, int revents); + static void Callback(uv_fs_poll_t* handle, + int status, + const uv_statbuf_t* prev, + const uv_statbuf_t* curr); void Stop(); - ev_stat watcher_; + uv_fs_poll_t watcher_; bool persistent_; - char *path_; }; } // namespace node |