int main(int argc, char **argv) { struct ndnd_handle *h; if (argc > 1) { fprintf(stderr, "%s", ndnd_usage_message); exit(1); } signal(SIGPIPE, SIG_IGN); h = ndnd_create(argv[0], stdiologger, stderr); if (h == NULL) exit(1); /*modified by zhy on 20131112*/ if(gateway_init()) { printf("gateway initial failed!\n"); exit(1); } ndnd_run(h); thread_flag=0;//recycle the thread pthread_detach(pid_listen); pthread_detach(pid_topo); close(fdusb); ndnd_msg(h, "exiting."); ndnd_destroy(&h); ERR_remove_state(0); EVP_cleanup(); CRYPTO_cleanup_all_ex_data(); exit(0); }
int main(int argc, char **argv) { struct ndnd_handle *h; if (argc > 1) { fprintf(stderr, "%s", ndnd_usage_message); exit(1); } signal(SIGPIPE, SIG_IGN); h = ndnd_create(argv[0], stdiologger, stderr); if (h == NULL) exit(1); ndnd_run(h); ndnd_msg(h, "exiting."); ndnd_destroy(&h); ERR_remove_state(0); EVP_cleanup(); exit(0); }