summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-20 16:56:11 +0000
committerDan Gohman <gohman@apple.com>2010-08-20 16:56:11 +0000
commite7b67d0e94df497791207618194e1db545ac3721 (patch)
tree1af157baed1b93965fe6eb0f7de7cbf214610e4f
parent7a4575e26e58da743cf6c921aadd0d5499717a68 (diff)
downloadllvm-e7b67d0e94df497791207618194e1db545ac3721.tar.gz
llvm-e7b67d0e94df497791207618194e1db545ac3721.tar.bz2
llvm-e7b67d0e94df497791207618194e1db545ac3721.tar.xz
Diagnose attempts to update standard output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111649 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/FileUpdate/FileUpdate.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/FileUpdate/FileUpdate.cpp b/utils/FileUpdate/FileUpdate.cpp
index b97d9cf74e..8377aea79e 100644
--- a/utils/FileUpdate/FileUpdate.cpp
+++ b/utils/FileUpdate/FileUpdate.cpp
@@ -36,6 +36,11 @@ int main(int argc, char **argv) {
PrettyStackTraceProgram X(argc, argv);
cl::ParseCommandLineOptions(argc, argv);
+ if (OutputFilename == "-") {
+ errs() << argv[0] << ": error: Can't update standard output\n";
+ return 1;
+ }
+
// Get the input data.
std::string ErrorStr;
MemoryBuffer *In =