fixed the location of SIGPIPE change in bin/hawk.c
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
24
bin/hawk.c
24
bin/hawk.c
@ -290,6 +290,20 @@ static void do_nothing (int unused)
|
||||
{
|
||||
}
|
||||
|
||||
static void set_intr_pipe (void)
|
||||
{
|
||||
#if !defined(_WIN32) && !defined(__OS2__) && !defined(__DOS__) && defined(SIGPIPE)
|
||||
set_signal_handler (SIGPIPE, do_nothing, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void unset_intr_pipe (void)
|
||||
{
|
||||
#if !defined(_WIN32) && !defined(__OS2__) && !defined(__DOS__) && defined(SIGPIPE)
|
||||
unset_signal_handler (SIGPIPE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void set_intr_run (void)
|
||||
{
|
||||
#if defined(SIGTERM)
|
||||
@ -301,9 +315,6 @@ static void set_intr_run (void)
|
||||
#if defined(SIGINT)
|
||||
set_signal_handler (SIGINT, stop_run, 0);
|
||||
#endif
|
||||
#if !defined(_WIN32) && !defined(__OS2__) && !defined(__DOS__) && defined(SIGPIPE)
|
||||
set_signal_handler (SIGPIPE, do_nothing, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void unset_intr_run (void)
|
||||
@ -317,9 +328,6 @@ static void unset_intr_run (void)
|
||||
#if defined(SIGINT)
|
||||
unset_signal_handler (SIGINT);
|
||||
#endif
|
||||
#if !defined(_WIN32) && !defined(__OS2__) && !defined(__DOS__) && defined(SIGPIPE)
|
||||
unset_signal_handler (SIGPIPE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static hawk_htb_walk_t print_awk_value (hawk_htb_t* map, hawk_htb_pair_t* pair, void* arg)
|
||||
@ -1170,6 +1178,8 @@ static HAWK_INLINE int execute_hawk (int argc, hawk_bch_t* argv[])
|
||||
mmgr = &xma_mmgr;
|
||||
}
|
||||
|
||||
set_intr_pipe();
|
||||
|
||||
hawk = hawk_openstdwithmmgr(mmgr, 0, hawk_get_cmgr_by_id(HAWK_CMGR_UTF8), HAWK_NULL);
|
||||
if (HAWK_UNLIKELY(!hawk))
|
||||
{
|
||||
@ -1307,6 +1317,8 @@ oops:
|
||||
if (rtx) hawk_rtx_close (rtx);
|
||||
if (hawk) hawk_close (hawk);
|
||||
|
||||
unset_intr_pipe ();
|
||||
|
||||
if (xma_mmgr.ctx)
|
||||
{
|
||||
if (app_debug) hawk_xma_dump (xma_mmgr.ctx, xma_dumper_without_hawk, HAWK_NULL);
|
||||
|
Reference in New Issue
Block a user