| Index: runtime/bin/file_system_watcher_linux.cc
|
| diff --git a/runtime/bin/file_system_watcher_linux.cc b/runtime/bin/file_system_watcher_linux.cc
|
| index bfdc941d0448dde1f22ce4f9f7be22f2ec71f1e9..cc1d43fd8e94ce67a0885e7d3fe38969f0a99a89 100644
|
| --- a/runtime/bin/file_system_watcher_linux.cc
|
| +++ b/runtime/bin/file_system_watcher_linux.cc
|
| @@ -23,7 +23,6 @@ bool FileSystemWatcher::IsSupported() {
|
| return true;
|
| }
|
|
|
| -
|
| intptr_t FileSystemWatcher::Init() {
|
| int id = NO_RETRY_EXPECTED(inotify_init1(IN_CLOEXEC));
|
| if (id < 0) {
|
| @@ -36,12 +35,10 @@ intptr_t FileSystemWatcher::Init() {
|
| return id;
|
| }
|
|
|
| -
|
| void FileSystemWatcher::Close(intptr_t id) {
|
| USE(id);
|
| }
|
|
|
| -
|
| intptr_t FileSystemWatcher::WatchPath(intptr_t id,
|
| const char* path,
|
| int events,
|
| @@ -66,18 +63,15 @@ intptr_t FileSystemWatcher::WatchPath(intptr_t id,
|
| return path_id;
|
| }
|
|
|
| -
|
| void FileSystemWatcher::UnwatchPath(intptr_t id, intptr_t path_id) {
|
| VOID_NO_RETRY_EXPECTED(inotify_rm_watch(id, path_id));
|
| }
|
|
|
| -
|
| intptr_t FileSystemWatcher::GetSocketId(intptr_t id, intptr_t path_id) {
|
| USE(path_id);
|
| return id;
|
| }
|
|
|
| -
|
| static int InotifyEventToMask(struct inotify_event* e) {
|
| int mask = 0;
|
| if ((e->mask & IN_CLOSE_WRITE) != 0) {
|
| @@ -104,7 +98,6 @@ static int InotifyEventToMask(struct inotify_event* e) {
|
| return mask;
|
| }
|
|
|
| -
|
| Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id, intptr_t path_id) {
|
| USE(path_id);
|
| const intptr_t kEventSize = sizeof(struct inotify_event);
|
| @@ -128,9 +121,10 @@ Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id, intptr_t path_id) {
|
| Dart_ListSetAt(event, 0, Dart_NewInteger(mask));
|
| Dart_ListSetAt(event, 1, Dart_NewInteger(e->cookie));
|
| if (e->len > 0) {
|
| - Dart_ListSetAt(event, 2, Dart_NewStringFromUTF8(
|
| - reinterpret_cast<uint8_t*>(e->name),
|
| - strlen(e->name)));
|
| + Dart_ListSetAt(
|
| + event, 2,
|
| + Dart_NewStringFromUTF8(reinterpret_cast<uint8_t*>(e->name),
|
| + strlen(e->name)));
|
| } else {
|
| Dart_ListSetAt(event, 2, Dart_Null());
|
| }
|
|
|