Skip to content

Commit 902eeb3

Browse files
committed
CHANGE: report port error reasons as positive integers
1 parent 710e669 commit 902eeb3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core/c-error.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ static REBOL_STATE Top_State; // Boot var: holds error state during boot
633633
val = Get_Object(spec, STD_PORT_SPEC_HEAD_REF); // most informative
634634
if (IS_NONE(val)) val = Get_Object(spec, STD_PORT_SPEC_HEAD_TITLE);
635635

636-
DS_PUSH_INTEGER(err_code);
636+
DS_PUSH_INTEGER(-err_code);
637637
Trap2(errnum, val, DS_TOP);
638638
}
639639

src/core/n-io.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ static REBSER *Read_All_File(char *fname)
592592
REBVAL *arg = D_ARG(1);
593593
REBSER *ser;
594594
REBINT n;
595-
REBVAL val, reason;
595+
REBVAL val;
596596

597597
ser = Value_To_OS_Path(arg, TRUE);
598598
// it should be safe not to check result from Value_To_OS_Path (it always succeeds)
@@ -609,8 +609,8 @@ static REBSER *Read_All_File(char *fname)
609609
SET_FILE(arg, ser);
610610

611611
if (NZ(n)) {
612-
SET_INTEGER(&reason, n);
613-
Trap2(RE_CANNOT_OPEN, arg, &reason);
612+
SET_INTEGER(D_RET, -n);
613+
Trap2(RE_CANNOT_OPEN, arg, D_RET);
614614
}
615615
return R_ARG1;
616616
}

0 commit comments

Comments
 (0)