Skip to content

Commit

Permalink
lin_xs_cli: exit with failure if main() promise is rejected
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Jan 11, 2020
1 parent c9423d1 commit 6e29865
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xs/platforms/lin_xs_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

extern void fxRunPromiseJobs(void* machine);
extern txS1 fxPromiseIsPending(xsMachine* the, xsSlot* promise);
extern txS1 fxPromiseIsRejected(xsMachine* the, xsSlot* promise);

void fxAbort(xsMachine* the)
{
Expand Down Expand Up @@ -65,6 +66,9 @@ int main(int argc, char* argv[]) // here
}
g_main_context_iteration(main, TRUE);
}
if (fxPromiseIsRejected(the, &xsVar(2))) {
error = 1;
}
g_main_context_unref(main);
}
xsCatch {
Expand Down

0 comments on commit 6e29865

Please sign in to comment.