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

Function _logsys_subsys_create

exec/logsys.c:427–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427int _logsys_subsys_create (const char *subsys, const char *filename)
428{
429 int i;
430
431 if ((subsys == NULL) ||
432 (strlen(subsys) >= LOGSYS_MAX_SUBSYS_NAMELEN)) {
433 return -1;
434 }
435
436 i = _logsys_config_subsys_get_unlocked (subsys);
437 if ((i > -1) && (i < LOGSYS_MAX_SUBSYS_COUNT)) {
438 _logsys_subsys_filename_add(i, filename);
439 return i;
440 }
441
442 for (i = 0; i < LOGSYS_MAX_SUBSYS_COUNT; i++) {
443 if (strcmp (logsys_loggers[i].subsys, "") == 0) {
444 logsys_subsys_init(subsys, i);
445 _logsys_subsys_filename_add(i, filename);
446 break;
447 }
448 }
449
450 if (i >= LOGSYS_MAX_SUBSYS_COUNT) {
451 i = -1;
452 }
453
454 return i;
455}
456
457int _logsys_config_subsys_get (const char *subsys)
458{

Callers 4

corosync_main_config_setFunction · 0.85
totemknet_initializeFunction · 0.85
_logsys_system_setupFunction · 0.85
mainFunction · 0.85

Calls 3

logsys_subsys_initFunction · 0.85

Tested by

no test coverage detected