summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/tools/clang-format/ClangFormat.cpp2
-rwxr-xr-xclang/tools/clang-format/clang-format-diff.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/clang/tools/clang-format/ClangFormat.cpp b/clang/tools/clang-format/ClangFormat.cpp
index e08aa2d5b8d..2ca2bed61a4 100644
--- a/clang/tools/clang-format/ClangFormat.cpp
+++ b/clang/tools/clang-format/ClangFormat.cpp
@@ -186,7 +186,7 @@ static bool format(std::string FileName) {
return true;
}
if (Code->getBufferSize() == 0)
- return true; // Empty files are formatted correctly.
+ return false; // Empty files are formatted correctly.
FileID ID = createInMemoryFile(FileName, Code.get(), Sources, Files);
std::vector<CharSourceRange> Ranges;
if (fillRanges(Sources, ID, Code.get(), Ranges))
diff --git a/clang/tools/clang-format/clang-format-diff.py b/clang/tools/clang-format/clang-format-diff.py
index 90723d217b8..ca949b84ef9 100755
--- a/clang/tools/clang-format/clang-format-diff.py
+++ b/clang/tools/clang-format/clang-format-diff.py
@@ -81,7 +81,8 @@ def main():
stdout, stderr = p.communicate()
if stderr:
print stderr
- return
+ if p.returncode != 0:
+ sys.exit(p.returncode);
if __name__ == '__main__':
OpenPOWER on IntegriCloud