main_common: Move init and cleanup function to main function

This commit is contained in:
Andreas Eversberg
2017-03-04 07:12:12 +01:00
parent 4201717f36
commit 3fc4fc54be
7 changed files with 20 additions and 59 deletions

View File

@@ -348,9 +348,6 @@ int main(int argc, char *argv[])
print_image();
/* init functions */
rc = init_common(station_id, 7);
if (rc < 0)
goto fail;
rc = init_frame();
if (rc < 0) {
fprintf(stderr, "Failed to setup frames. Quitting!\n");
@@ -380,7 +377,7 @@ int main(int argc, char *argv[])
nmt_check_channels();
main_common(&quit, latency, interval, myhandler);
main_common(&quit, latency, interval, myhandler, station_id, 7);
fail:
/* fifo */
@@ -388,9 +385,6 @@ fail:
close(sms_deliver_fd);
unlink(SMS_DELIVER);
/* cleanup functions */
cleanup_common();
/* destroy transceiver instance */
while (sender_head)
nmt_destroy(sender_head);