| Index: runtime/bin/file_system_watcher_android.cc
|
| diff --git a/runtime/bin/file_system_watcher_android.cc b/runtime/bin/file_system_watcher_android.cc
|
| index abece4c0a752007986796d6642515d103803f16c..561c0d42e86192a39a8ae79c88987c7286113570 100644
|
| --- a/runtime/bin/file_system_watcher_android.cc
|
| +++ b/runtime/bin/file_system_watcher_android.cc
|
| @@ -22,7 +22,6 @@ bool FileSystemWatcher::IsSupported() {
|
| return true;
|
| }
|
|
|
| -
|
| intptr_t FileSystemWatcher::Init() {
|
| int id = NO_RETRY_EXPECTED(inotify_init());
|
| if (id < 0 || !FDUtils::SetCloseOnExec(id)) {
|
| @@ -35,12 +34,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,
|
| @@ -65,18 +62,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) {
|
| @@ -103,7 +97,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);
|
| @@ -126,9 +119,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());
|
| }
|
|
|