[Lldb-commits] [lldb] 54c3c2e - [lldb-vscode] Consistently use return EXIT_SUCCESS and EXIT_FAILURE (NFC)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 31 21:42:07 PDT 2021


Author: Jonas Devlieghere
Date: 2021-03-31T21:41:59-07:00
New Revision: 54c3c2e82874d8ee65b32f1f79bfd494b0551986

URL: https://github.com/llvm/llvm-project/commit/54c3c2e82874d8ee65b32f1f79bfd494b0551986
DIFF: https://github.com/llvm/llvm-project/commit/54c3c2e82874d8ee65b32f1f79bfd494b0551986.diff

LOG: [lldb-vscode] Consistently use return EXIT_SUCCESS and EXIT_FAILURE (NFC)

Consistently use return with EXIT_SUCCESS or EXIT_FAILURE instead of
mix-and-matching return, exit 0, 1 etc.

Differential revision: https://reviews.llvm.org/D99701

Added: 
    

Modified: 
    lldb/tools/lldb-vscode/lldb-vscode.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/tools/lldb-vscode/lldb-vscode.cpp b/lldb/tools/lldb-vscode/lldb-vscode.cpp
index 9a6a0f5b69f06..896ea61f97426 100644
--- a/lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ b/lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -3105,7 +3105,7 @@ int main(int argc, char *argv[]) {
     } else {
       llvm::errs() << "\"--launch-target\" requires \"--comm-file\" to be "
                       "specified\n";
-      exit(EXIT_FAILURE);
+      return EXIT_FAILURE;
     }
   }
 
@@ -3118,7 +3118,7 @@ int main(int argc, char *argv[]) {
 
   if (input_args.hasArg(OPT_help)) {
     printHelp(T, llvm::sys::path::filename(argv[0]));
-    return 0;
+    return EXIT_SUCCESS;
   }
 
   if (auto *arg = input_args.getLastArg(OPT_port)) {
@@ -3127,7 +3127,7 @@ int main(int argc, char *argv[]) {
     portno = strtol(optarg, &remainder, 0);
     if (remainder == optarg || *remainder != '\0') {
       fprintf(stderr, "'%s' is not a valid port number.\n", optarg);
-      exit(1);
+      return EXIT_FAILURE;
     }
   }
 
@@ -3144,7 +3144,7 @@ int main(int argc, char *argv[]) {
       g_vsc.input.descriptor = StreamDescriptor::from_socket(socket_fd, true);
       g_vsc.output.descriptor = StreamDescriptor::from_socket(socket_fd, false);
     } else {
-      exit(1);
+      return EXIT_FAILURE;
     }
   } else {
     g_vsc.input.descriptor = StreamDescriptor::from_file(fileno(stdin), false);
@@ -3168,5 +3168,5 @@ int main(int argc, char *argv[]) {
   // We must terminate the debugger in a thread before the C++ destructor
   // chain messes everything up.
   lldb::SBDebugger::Terminate();
-  return 0;
+  return EXIT_SUCCESS;
 }


        


More information about the lldb-commits mailing list