MCPcopy Create free account
hub / github.com/corosync/corosync / main

Function main

exec/main.c:1284–1677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1282}
1283
1284int main (int argc, char **argv, char **envp)
1285{
1286 const char *error_string;
1287 struct totem_config totem_config;
1288 int res, ch;
1289 int background, sched_rr, prio, testonly;
1290 enum move_to_root_cgroup_mode move_to_root_cgroup;
1291 enum e_corosync_done flock_err;
1292 uint64_t totem_config_warnings;
1293 struct scheduler_pause_timeout_data scheduler_pause_timeout_data;
1294 long int tmpli;
1295 char *ep;
1296 char *tmp_str;
1297 int log_subsys_id_totem;
1298 int silent;
1299
1300 /* default configuration
1301 */
1302 background = 1;
1303 testonly = 0;
1304
1305 while ((ch = getopt (argc, argv, "c:l:ftv")) != EOF) {
1306
1307 switch (ch) {
1308 case 'c':
1309 res = snprintf(corosync_config_file, sizeof(corosync_config_file), "%s", optarg);
1310 if (res >= sizeof(corosync_config_file)) {
1311 fprintf (stderr, "Config file path too long.\n");
1312 syslog (LOGSYS_LEVEL_ERROR, "Config file path too long.");
1313
1314 logsys_system_fini();
1315 return EXIT_FAILURE;
1316 }
1317 break;
1318 case 'l':
1319 res = snprintf(corosync_lock_file, sizeof(corosync_lock_file), "%s", optarg);
1320 if (res >= sizeof(corosync_lock_file)) {
1321 fprintf (stderr, "PID lock file path too long.\n");
1322 syslog (LOGSYS_LEVEL_ERROR, "PID lock file path too long.");
1323
1324 logsys_system_fini();
1325 return EXIT_FAILURE;
1326 }
1327 break;
1328 case 'f':
1329 background = 0;
1330 break;
1331 case 't':
1332 testonly = 1;
1333 break;
1334 case 'v':
1335 show_version_info();
1336 logsys_system_fini();
1337 return EXIT_SUCCESS;
1338
1339 break;
1340 default:
1341 fprintf(stderr, \

Callers

nothing calls this directly

Calls 15

logsys_system_finiFunction · 0.85
show_version_infoFunction · 0.85
icmap_initFunction · 0.85
set_icmap_ro_keys_flagFunction · 0.85
apidef_getFunction · 0.85
coroparse_configparseFunction · 0.85
icmap_get_global_mapFunction · 0.85
stats_map_initFunction · 0.85
_logsys_subsys_createFunction · 0.85
get_state_dirFunction · 0.85
totem_config_readFunction · 0.85
totem_config_validateFunction · 0.85

Tested by

no test coverage detected