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

Function shutdown_do

tools/corosync-cfgtool.c:423–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423static void shutdown_do(int force)
424{
425 cs_error_t result;
426 corosync_cfg_handle_t handle;
427 corosync_cfg_callbacks_t callbacks;
428 int flag;
429
430 callbacks.corosync_cfg_shutdown_callback = NULL;
431 if (force) {
432 flag = COROSYNC_CFG_SHUTDOWN_FLAG_REGARDLESS;
433 } else {
434 flag = COROSYNC_CFG_SHUTDOWN_FLAG_REQUEST;
435 }
436
437 result = corosync_cfg_initialize (&handle, &callbacks);
438 if (result != CS_OK) {
439 fprintf (stderr, "Could not initialize corosync configuration API error %d\n", result);
440 exit (EXIT_FAILURE);
441 }
442
443 printf ("Shutting down corosync\n");
444 cs_repeat(result, 30, corosync_cfg_try_shutdown (handle, flag));
445 if (result != CS_OK) {
446 fprintf (stderr, "Could not shutdown (error = %d)\n", result);
447 }
448
449 (void)corosync_cfg_finalize (handle);
450}
451
452static int showaddrs_do(unsigned int nodeid)
453{

Callers 1

mainFunction · 0.85

Calls 3

corosync_cfg_initializeFunction · 0.85
corosync_cfg_finalizeFunction · 0.85

Tested by

no test coverage detected