| Index: runtime/bin/file.cc
|
| diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
|
| index 4037dc9f3db57c315198a1b44073d770bde88e6d..784f25854a7b8e6b46453bc9ce13ba04c3f24bea 100644
|
| --- a/runtime/bin/file.cc
|
| +++ b/runtime/bin/file.cc
|
| @@ -218,7 +218,7 @@ void FUNCTION_NAME(File_Position)(Dart_NativeArguments args) {
|
|
|
| void FUNCTION_NAME(File_SetPosition)(Dart_NativeArguments args) {
|
| Dart_EnterScope();
|
| - intptr_t return_value = -1;
|
| + bool return_value = false;
|
| intptr_t value =
|
| DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 0));
|
| File* file = reinterpret_cast<File*>(value);
|
| @@ -227,7 +227,23 @@ void FUNCTION_NAME(File_SetPosition)(Dart_NativeArguments args) {
|
| DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1));
|
| return_value = file->SetPosition(position);
|
| }
|
| - Dart_SetReturnValue(args, Dart_NewInteger(return_value));
|
| + Dart_SetReturnValue(args, Dart_NewBoolean(return_value));
|
| + Dart_ExitScope();
|
| +}
|
| +
|
| +
|
| +void FUNCTION_NAME(File_Truncate)(Dart_NativeArguments args) {
|
| + Dart_EnterScope();
|
| + bool return_value = false;
|
| + intptr_t value =
|
| + DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 0));
|
| + File* file = reinterpret_cast<File*>(value);
|
| + if (file != NULL) {
|
| + int64_t length =
|
| + DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1));
|
| + return_value = file->Truncate(length);
|
| + }
|
| + Dart_SetReturnValue(args, Dart_NewBoolean(return_value));
|
| Dart_ExitScope();
|
| }
|
|
|
|
|