[GraphWriter] Don't wait on xdg-open when not on Apple.
[oota-llvm.git] / lib / Support / GraphWriter.cpp
index 97aedc88473a2db08d6fa7ff3ef82d36041c5007..a9b022041468bc3f81f0c44ff1fb6662f5beca44 100644 (file)
@@ -135,12 +135,12 @@ static const char *getProgramName(GraphProgram::Name program) {
 bool llvm::DisplayGraph(StringRef FilenameRef, bool wait,
                         GraphProgram::Name program) {
   std::string Filename = FilenameRef;
-  wait &= !ViewBackground;
   std::string ErrMsg;
   std::string ViewerPath;
   GraphSession S;
 
 #ifdef __APPLE__
+  wait &= !ViewBackground;
   if (S.TryFindProgram("open", ViewerPath)) {
     std::vector<const char *> args;
     args.push_back(ViewerPath.c_str());