diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-04-29 15:57:31 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-04-29 16:01:55 (GMT) |
commit | bb10325339898d2833a9f24e9e0252b2c257beb1 (patch) | |
tree | 7f78186d78e2e060a26ece346129aba9015d3515 /src/deps_log.cc | |
parent | 3699cb6aa2fb29125bf725cb50fbcc593da8a8a1 (diff) | |
download | Ninja-bb10325339898d2833a9f24e9e0252b2c257beb1.zip Ninja-bb10325339898d2833a9f24e9e0252b2c257beb1.tar.gz Ninja-bb10325339898d2833a9f24e9e0252b2c257beb1.tar.bz2 |
Introduce a Truncate() function that works on POSIX and Windows.
Hopefully fixes the build on Windows.
Diffstat (limited to 'src/deps_log.cc')
-rw-r--r-- | src/deps_log.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/deps_log.cc b/src/deps_log.cc index c52503b..9866540 100644 --- a/src/deps_log.cc +++ b/src/deps_log.cc @@ -215,10 +215,8 @@ bool DepsLog::Load(const string& path, State* state, string* err) { } fclose(f); - if (truncate(path.c_str(), offset) < 0) { - *err = strerror(errno); + if (!Truncate(path.c_str(), offset, err)) return false; - } // The truncate succeeded; we'll just report the load error as a // warning because the build can proceed. |