Ver código fonte

wamrc: return a non-zero exit code on failure (#822)

YAMAMOTO Takashi 4 anos atrás
pai
commit
d1be75c4a1
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      wamr-compiler/main.c

+ 3 - 1
wamr-compiler/main.c

@@ -84,6 +84,7 @@ main(int argc, char *argv[])
     char error_buf[128];
     int log_verbose_level = 2;
     bool sgx_mode = false;
+    int exit_status = EXIT_FAILURE;
 
     option.opt_level = 3;
     option.size_level = 3;
@@ -296,6 +297,7 @@ main(int argc, char *argv[])
     bh_print_time("Compile end");
 
     printf("Compile success, file %s was generated.\n", out_file_name);
+    exit_status = EXIT_SUCCESS;
 
 fail5:
     /* Destroy compiler context */
@@ -318,5 +320,5 @@ fail1:
     wasm_runtime_destroy();
 
     bh_print_time("wamrc return");
-    return 0;
+    return exit_status;
 }