Skip to content

Commit

Permalink
Per reviwer comment added SIGHUP to the non-error signals and added #…
Browse files Browse the repository at this point in the history
…idef to the signals names
  • Loading branch information
davidBar-On committed Feb 8, 2025
1 parent 4bab9bc commit 7e8a19f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -4847,6 +4847,8 @@ iperf_catch_sigend(void (*handler)(int))
void
iperf_got_sigend(struct iperf_test *test, int sig)
{
int exit_type;

/*
* If we're the client, or if we're a server and running a test,
* then dump out the accumulated stats so far.
Expand All @@ -4868,7 +4870,18 @@ iperf_got_sigend(struct iperf_test *test, int sig)
(void) Nwrite(test->ctrl_sck, (char*) &test->state, sizeof(signed char), Ptcp);
}
i_errno = (test->role == 'c') ? IECLIENTTERM : IESERVERTERM;
if (sig == SIGTERM) {

exit_type = 0;
#ifdef SIGTERM
if (sig == SIGTERM)
exit_type = 1;
else
#endif
#ifdef SIGHUP
if (sig == SIGHUP)
exit_type = 1;
#endif
if (exit_type == 1) {
iperf_signormalexit(test, "interrupt - %s by signal %s(%d)", iperf_strerror(i_errno), strsignal(sig), sig);
} else {
iperf_errexit(test, "interrupt - %s by signal %s(%d)", iperf_strerror(i_errno), strsignal(sig), sig);
Expand Down

0 comments on commit 7e8a19f

Please sign in to comment.