Skip to content

Commit 54dff20

Browse files
committed
---
yaml --- r: 5231 b: refs/heads/master c: 0ea55ff h: refs/heads/master i: 5229: b929eb0 5227: 28bad48 5223: 7c35f2b 5215: 50b619c v: v3
1 parent febfdcc commit 54dff20

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 6f6f36172b2e0cd86ffffd1d0ed2deb75972db72
2+
refs/heads/master: 0ea55ffdc87cd65de707d2d947cb57084be950f7

trunk/src/rt/rust_internal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ static size_t const TIME_SLICE_IN_MS = 10;
9999

100100
static size_t const BUF_BYTES = 2048;
101101

102+
// The error status to use when the process fails
103+
#define PROC_FAIL_CODE 101;
104+
102105
// Every reference counted object should use this macro and initialize
103106
// ref_count.
104107

trunk/src/rt/rust_kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ rust_kernel::fail() {
140140
// Runtime to terminate it in an unusual way" when trying to shutdown
141141
// cleanly.
142142
#if defined(__WIN32__)
143-
exit(1);
143+
exit(rval);
144144
#endif
145145
for(size_t i = 0; i < num_threads; ++i) {
146146
rust_scheduler *thread = threads[i];

trunk/src/rt/rust_scheduler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ rust_scheduler::fail() {
7171
log(NULL, log_err, "domain %s @0x%" PRIxPTR " root task failed",
7272
name, this);
7373
I(this, kernel->rval == 0);
74-
kernel->rval = 1;
74+
kernel->rval = PROC_FAIL_CODE;
7575
kernel->fail();
7676
}
7777

trunk/src/test/compiletest/runtest.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,21 @@ fn run_rfail_test(cx: &cx, props: &test_props, testfile: &str) {
5151

5252
procres = exec_compiled_test(cx, props, testfile);
5353

54-
if procres.status == 0 {
55-
fatal_procres("run-fail test didn't produce an error!", procres);
56-
}
57-
54+
// The value our Makefile configures valgrind to return on failure
5855
const valgrind_err: int = 100;
5956
if procres.status == valgrind_err {
6057
fatal_procres("run-fail test isn't valgrind-clean!", procres);
6158
}
6259

60+
// The value the rust runtime returns on failure
61+
const rust_err: int = 101;
62+
if procres.status != rust_err {
63+
fatal_procres(
64+
#fmt("run-fail test produced the wrong error code: %d",
65+
procres.status),
66+
procres);
67+
}
68+
6369
check_error_patterns(props, testfile, procres);
6470
}
6571

0 commit comments

Comments
 (0)