/* bind the socket and start listening */ static int _server_proc_init(void) { ice_config_t *config; if (!_setup_sockets()) return 0; if (!_start_listening()) { _fatal_error("Failed trying to listen on server socket"); return 0; } config = config_get_config_unlocked(); /* recreate the pid file */ if (config->pidfile) { FILE *f; pidfile = strdup (config->pidfile); if (pidfile && (f = fopen (config->pidfile, "w")) != NULL) { fprintf (f, "%d\n", (int)getpid()); fclose (f); } } return 1; }
/* bind the socket and start listening */ static int _server_proc_init(void) { if (!_setup_sockets()) return 0; if (!_start_listening()) { _fatal_error("Failed trying to listen on server socket"); return 0; } return 1; }