Skip to content

Commit

Permalink
CHANGE: report port error reasons as positive integers
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jan 21, 2022
1 parent 710e669 commit 902eeb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/c-error.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ static REBOL_STATE Top_State; // Boot var: holds error state during boot
val = Get_Object(spec, STD_PORT_SPEC_HEAD_REF); // most informative
if (IS_NONE(val)) val = Get_Object(spec, STD_PORT_SPEC_HEAD_TITLE);

DS_PUSH_INTEGER(err_code);
DS_PUSH_INTEGER(-err_code);
Trap2(errnum, val, DS_TOP);
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/n-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ static REBSER *Read_All_File(char *fname)
REBVAL *arg = D_ARG(1);
REBSER *ser;
REBINT n;
REBVAL val, reason;
REBVAL val;

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

if (NZ(n)) {
SET_INTEGER(&reason, n);
Trap2(RE_CANNOT_OPEN, arg, &reason);
SET_INTEGER(D_RET, -n);
Trap2(RE_CANNOT_OPEN, arg, D_RET);
}
return R_ARG1;
}
Expand Down

0 comments on commit 902eeb3

Please sign in to comment.