diff options
author | Nico Weber <nicolasweber@gmx.de> | 2015-03-19 15:42:46 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2015-03-19 16:45:58 (GMT) |
commit | b334523f1da03adfcd23b6e7e7a66c8fcbf87840 (patch) | |
tree | aa073a311c1e3380e26592b85e437322757f2921 /src/build.h | |
parent | bc38ef76ebfabe503b1b56a1e32827a851037766 (diff) | |
download | Ninja-b334523f1da03adfcd23b6e7e7a66c8fcbf87840.zip Ninja-b334523f1da03adfcd23b6e7e7a66c8fcbf87840.tar.gz Ninja-b334523f1da03adfcd23b6e7e7a66c8fcbf87840.tar.bz2 |
Make failing stat() calls abort the build.
Fixes #830, fixes #904.
In practice, this either happens with 64-bit inodes and a 32-bit
userspace when building without -D_FILE_OFFSET_BITS=64 in CFLAGS, or
when a filename is longer than the system file length limit.
Since DiskInterface::Stat() returns -1 on error, and Node used -1 on
"stat state unknown", not aborting the build lead to ninja stat()ing the
same file over and over again, until it finally ran out of stack. That's
now fixed.
* Change RecomputeOutputsDirty() to return success instead of dirty
state (like RecomputeDirty()) and return the dirty state in a bool
outparam
* Node::Stat()s old return value wasn't used anywhere, change the
function to return success instead and add an |err| outparam
* Node::StatIfNecessary()'s old return value was used only in one place.
Change that place to explicitly check status_known() and make
StatIfNecessary() return success and add an |err| outparam
* Plan::CleanNode() can now fail, make it return bool and add an |err|
outparam
Diffstat (limited to 'src/build.h')
-rw-r--r-- | src/build.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/build.h b/src/build.h index eb3636a..5d5db80 100644 --- a/src/build.h +++ b/src/build.h @@ -61,7 +61,8 @@ struct Plan { void EdgeFinished(Edge* edge); /// Clean the given node during the build. - void CleanNode(DependencyScan* scan, Node* node); + /// Return false on error. + bool CleanNode(DependencyScan* scan, Node* node, string* err); /// Number of edges with commands to run. int command_edge_count() const { return command_edges_; } |