Skip to content

Commit

Permalink
print signal number
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed Aug 16, 2024
1 parent 101d530 commit 9800afc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ww/managers/signal_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ void setSignalManager(signal_manager_t *sm)

static void multiplexedSignalHandler(int signum)
{
char message[50];
int length = snprintf(message, sizeof(message), "SignalManager: Received signal %d\n", signum);
write(STDOUT_FILENO, message, length);

if (state->raise_defaults)
{
signal(signum, SIG_DFL);
Expand All @@ -63,6 +67,8 @@ static void multiplexedSignalHandler(int signum)

static void multiplexedSignalHandlerNoArg(void)
{
static const char kMessage[] = "SignalManager: Executing exit callabck\n";
write(STDOUT_FILENO, kMessage, sizeof(kMessage) - 1);

for (unsigned int i = 0; i < state->handlers_len; i++)
{
Expand Down

0 comments on commit 9800afc

Please sign in to comment.