diff options
author | Dan Gohman <gohman@apple.com> | 2010-08-20 16:56:11 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-08-20 16:56:11 +0000 |
commit | 2fb75f0455d47bec2ffce439591722da4edf3cc0 (patch) | |
tree | 1a512b949fa516b746de9c13af53c5fbd9d1fccb /llvm/utils/FileUpdate/FileUpdate.cpp | |
parent | fe99020b479aa4d99941f3a36b3895ca3b2bd1a3 (diff) | |
download | llvm-2fb75f0455d47bec2ffce439591722da4edf3cc0.zip llvm-2fb75f0455d47bec2ffce439591722da4edf3cc0.tar.gz llvm-2fb75f0455d47bec2ffce439591722da4edf3cc0.tar.bz2 |
Diagnose attempts to update standard output.
llvm-svn: 111649
Diffstat (limited to 'llvm/utils/FileUpdate/FileUpdate.cpp')
-rw-r--r-- | llvm/utils/FileUpdate/FileUpdate.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/utils/FileUpdate/FileUpdate.cpp b/llvm/utils/FileUpdate/FileUpdate.cpp index b97d9cf..8377aea 100644 --- a/llvm/utils/FileUpdate/FileUpdate.cpp +++ b/llvm/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 = |