From b76897eb00bdfd2bd8f0579771eed59c2b4218ca Mon Sep 17 00:00:00 2001 From: "ajohnsen@google.com" Date: Tue, 19 Nov 2013 12:32:29 +0000 Subject: [PATCH] Fix File truncate on Windows. BUG= R=sgjesse@google.com Review URL: https://codereview.chromium.org//76283002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30406 260f80e4-7a28-3924-810f-c04153c831b5 --- runtime/bin/file_win.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc index 0b63b3d2acf..4c3c853d5c5 100644 --- a/runtime/bin/file_win.cc +++ b/runtime/bin/file_win.cc @@ -86,7 +86,7 @@ bool File::SetPosition(off64_t position) { bool File::Truncate(off64_t length) { ASSERT(handle_->fd() >= 0); - return (_chsize_s(handle_->fd(), length) != -1); + return _chsize_s(handle_->fd(), length) == 0; }