changed to call hawk_rtx_cleario() before restoring SIGPIPE handler in bin/main.c
This commit is contained in:
parent
a93beaaf55
commit
e54537886c
@ -1221,6 +1221,11 @@ static HAWK_INLINE int execute_hawk (int argc, hawk_bch_t* argv[])
|
|||||||
hawk_rtx_execwithbcstrarr(rtx, (const hawk_bch_t**)arg.icf.ptr, arg.icf.size);
|
hawk_rtx_execwithbcstrarr(rtx, (const hawk_bch_t**)arg.icf.ptr, arg.icf.size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* clear unflushed io data - this is also done by hawk_rtx_close().
|
||||||
|
* but i restore the SIGPIPE handler to the default in unset_intr_run().
|
||||||
|
* any output after this restoration may cause the program to terminate for unhandled SIGPIPE */
|
||||||
|
hawk_rtx_cleario (rtx);
|
||||||
|
|
||||||
unset_intr_run ();
|
unset_intr_run ();
|
||||||
|
|
||||||
if (retv)
|
if (retv)
|
||||||
|
@ -432,7 +432,7 @@ static int flush_io (hawk_rtx_t* rtx, int rio, const hawk_ooch_t* name, int n)
|
|||||||
|
|
||||||
if (rtx->rio.handler[rio] != HAWK_NULL)
|
if (rtx->rio.handler[rio] != HAWK_NULL)
|
||||||
{
|
{
|
||||||
n2 = hawk_rtx_flushio (rtx, rio, name);
|
n2 = hawk_rtx_flushio(rtx, rio, name);
|
||||||
if (n2 <= -1)
|
if (n2 <= -1)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -478,7 +478,7 @@ static int fnc_fflush (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
|
|||||||
* BEGIN { flush(); } # flush() returns -1
|
* BEGIN { flush(); } # flush() returns -1
|
||||||
* BEGIN { print 1; flush(); } # flush() returns 0
|
* BEGIN { print 1; flush(); } # flush() returns 0
|
||||||
*/
|
*/
|
||||||
n = hawk_rtx_flushio (rtx, HAWK_OUT_CONSOLE, HAWK_T(""));
|
n = hawk_rtx_flushio(rtx, HAWK_OUT_CONSOLE, HAWK_T(""));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3356,7 +3356,7 @@ static int run_printf (hawk_rtx_t* rtx, hawk_nde_print_t* nde)
|
|||||||
HAWK_ASSERT (head != HAWK_NULL);
|
HAWK_ASSERT (head != HAWK_NULL);
|
||||||
|
|
||||||
v = eval_expression(rtx, head);
|
v = eval_expression(rtx, head);
|
||||||
if (v == HAWK_NULL) goto oops_1;
|
if (HAWK_UNLIKELY(!v)) goto oops_1;
|
||||||
|
|
||||||
hawk_rtx_refupval (rtx, v);
|
hawk_rtx_refupval (rtx, v);
|
||||||
vtype = HAWK_RTX_GETVALTYPE(rtx, v);
|
vtype = HAWK_RTX_GETVALTYPE(rtx, v);
|
||||||
@ -5547,8 +5547,8 @@ static hawk_val_t* eval_binop_match0 (
|
|||||||
hawk_oocs_t out;
|
hawk_oocs_t out;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
out.ptr = hawk_rtx_getvaloocstr (rtx, left, &out.len);
|
out.ptr = hawk_rtx_getvaloocstr(rtx, left, &out.len);
|
||||||
if (out.ptr == HAWK_NULL) return HAWK_NULL;
|
if (HAWK_UNLIKELY(!out.ptr)) return HAWK_NULL;
|
||||||
|
|
||||||
n = hawk_rtx_matchvalwithoocs(rtx, right, &out, &out, HAWK_NULL, HAWK_NULL);
|
n = hawk_rtx_matchvalwithoocs(rtx, right, &out, &out, HAWK_NULL, HAWK_NULL);
|
||||||
hawk_rtx_freevaloocstr (rtx, left, out.ptr);
|
hawk_rtx_freevaloocstr (rtx, left, out.ptr);
|
||||||
|
Loading…
Reference in New Issue
Block a user