Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/sms-tool_q/src/sms_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static void resetserial()
close(port);
}

static void timeout()
static void timeout(int sig __attribute__((unused)))
{
fprintf(stderr,"No response from modem.\n");
exit(2);
Expand Down
18 changes: 14 additions & 4 deletions application/tom_modem/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ int run_op(PROFILE_T *profile, void *transport)
return UNKNOWN_ERROR;
}

static void clean_up()
static void clean_up(int sig __attribute__((unused)))
{
dbg_msg("Clean up success");

Expand All @@ -216,6 +216,16 @@ static void clean_up()
#endif
}

static void atexit_cleanup(void)
{
clean_up(0);
}

static void signal_cleanup(int sig __attribute__((unused)))
{
clean_up(sig);
}

int main(int argc, char *argv[])
{
PROFILE_T *profile = &s_profile;
Expand All @@ -229,9 +239,9 @@ int main(int argc, char *argv[])
}

// Setup cleanup and signal handlers
atexit(clean_up);
signal(SIGINT, clean_up);
signal(SIGTERM, clean_up);
atexit(atexit_cleanup);
signal(SIGINT, signal_cleanup);
signal(SIGTERM, signal_cleanup);

#ifdef USE_SEMAPHORE
if (profile->op == CLEANUP_SEMAPHORE_OP)
Expand Down