about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_internal.h3
-rw-r--r--src/rt/rust_kernel.cpp2
-rw-r--r--src/rt/rust_scheduler.cpp2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h
index d2c8574280b..c01fc5f3127 100644
--- a/src/rt/rust_internal.h
+++ b/src/rt/rust_internal.h
@@ -99,6 +99,9 @@ static size_t const TIME_SLICE_IN_MS = 10;
 
 static size_t const BUF_BYTES = 2048;
 
+// The error status to use when the process fails
+#define PROC_FAIL_CODE 101;
+
 // Every reference counted object should use this macro and initialize
 // ref_count.
 
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp
index 54b1cc98d43..e5234b9d6f5 100644
--- a/src/rt/rust_kernel.cpp
+++ b/src/rt/rust_kernel.cpp
@@ -140,7 +140,7 @@ rust_kernel::fail() {
     // Runtime to terminate it in an unusual way" when trying to shutdown
     // cleanly.
 #if defined(__WIN32__)
-    exit(1);
+    exit(rval);
 #endif
     for(size_t i = 0; i < num_threads; ++i) {
         rust_scheduler *thread = threads[i];
diff --git a/src/rt/rust_scheduler.cpp b/src/rt/rust_scheduler.cpp
index 3a69184d3fe..b127ec77efa 100644
--- a/src/rt/rust_scheduler.cpp
+++ b/src/rt/rust_scheduler.cpp
@@ -71,7 +71,7 @@ rust_scheduler::fail() {
     log(NULL, log_err, "domain %s @0x%" PRIxPTR " root task failed",
         name, this);
     I(this, kernel->rval == 0);
-    kernel->rval = 1;
+    kernel->rval = PROC_FAIL_CODE;
     kernel->fail();
 }