SILC_TASK_CALLBACK(stop_server)
{
- /* Stop scheduler, the program will stop eventually after noticing
- that the scheduler is down. */
- silc_schedule_stop(silcd->schedule);
+ silc_server_stop(silcd);
}
/* Dump server statistics into a file into /tmp directory */
silc_pkcs_register_default();
silc_hash_register_default();
silc_hmac_register_default();
- silc_create_key_pair(opt_pkcs, opt_bits, pubfile, prvfile,
- opt_identifier, "", NULL, NULL, FALSE);
+ if (!silc_create_key_pair(opt_pkcs, opt_bits, pubfile, prvfile,
+ opt_identifier, "", NULL, NULL, FALSE))
+ exit(1);
exit(0);
}
silc_file_writefile(pidfile, buf, strlen(buf));
}
- silc_server_drop_privs(silcd);
}
+ silc_server_drop_privs(silcd);
/* Run the server. When this returns the server has been stopped
and we will exit. */
silc_server_run(silcd);
- /* Stop the server and free it. */
- silc_server_stop(silcd);
+ /* Free server */
silc_server_config_destroy(silcd->config);
silc_server_free(silcd);