Diagnose attempts to update standard output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111649 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/FileUpdate/FileUpdate.cpp b/utils/FileUpdate/FileUpdate.cpp
index b97d9cf..8377aea 100644
--- a/utils/FileUpdate/FileUpdate.cpp
+++ b/utils/FileUpdate/FileUpdate.cpp
@@ -36,6 +36,11 @@
   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 =