File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ static void resetserial()
112112 close (port );
113113}
114114
115- static void timeout ()
115+ static void timeout (int sig __attribute__(( unused )) )
116116{
117117 fprintf (stderr ,"No response from modem.\n" );
118118 exit (2 );
Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ int run_op(PROFILE_T *profile, void *transport)
201201 return UNKNOWN_ERROR ;
202202}
203203
204- static void clean_up ()
204+ static void clean_up (int sig __attribute__(( unused )) )
205205{
206206 dbg_msg ("Clean up success" );
207207
@@ -216,6 +216,16 @@ static void clean_up()
216216#endif
217217}
218218
219+ static void atexit_cleanup (void )
220+ {
221+ clean_up (0 );
222+ }
223+
224+ static void signal_cleanup (int sig __attribute__((unused )))
225+ {
226+ clean_up (sig );
227+ }
228+
219229int main (int argc , char * argv [])
220230{
221231 PROFILE_T * profile = & s_profile ;
@@ -229,9 +239,9 @@ int main(int argc, char *argv[])
229239 }
230240
231241 // Setup cleanup and signal handlers
232- atexit (clean_up );
233- signal (SIGINT , clean_up );
234- signal (SIGTERM , clean_up );
242+ atexit (atexit_cleanup );
243+ signal (SIGINT , signal_cleanup );
244+ signal (SIGTERM , signal_cleanup );
235245
236246#ifdef USE_SEMAPHORE
237247 if (profile -> op == CLEANUP_SEMAPHORE_OP )
You can’t perform that action at this time.
0 commit comments