corosync/0009-totem-Propagate-totem-initialization-failure.patch

69 lines
1.7 KiB
Diff
Raw Normal View History

--- corosync-2.4.2.orig/exec/main.c 2017-07-11 17:23:41.903330368 +0800
+++ corosync-2.4.2/exec/main.c 2017-07-11 17:31:08.687343622 +0800
@@ -1424,9 +1424,13 @@
* Join multicast group and setup delivery
* and configuration change functions
*/
- totempg_initialize (
+ if(totempg_initialize (
corosync_poll_handle,
- &totem_config);
+ &totem_config) != 0) {
+
+ log_printf (LOGSYS_LEVEL_ERROR, "Can't initialize TOTEM layer");
+ corosync_exit_error (COROSYNC_DONE_FATAL_ERR);
+ }
totempg_service_ready_register (
main_service_ready);
--- corosync-2.4.2.orig/exec/totempg.c 2016-11-08 00:39:12.000000000 +0800
+++ corosync-2.4.2/exec/totempg.c 2017-07-11 17:27:47.615337658 +0800
@@ -814,6 +814,10 @@
totempg_confchg_fn,
totempg_waiting_trans_ack_cb);
+ if (res == -1) {
+ goto error_exit;
+ }
+
totemmrp_callback_token_create (
&callback_token_received_handle,
TOTEM_CALLBACK_TOKEN_RECEIVED,
@@ -827,6 +831,7 @@
list_init (&totempg_groups_list);
+error_exit:
return (res);
}
--- corosync-2.4.2.orig/exec/totemsrp.c 2016-11-08 00:39:12.000000000 +0800
+++ corosync-2.4.2/exec/totemsrp.c 2017-07-11 17:30:30.887342501 +0800
@@ -851,6 +851,7 @@
int waiting_trans_ack))
{
struct totemsrp_instance *instance;
+ int res;
instance = malloc (sizeof (struct totemsrp_instance));
if (instance == NULL) {
@@ -993,7 +994,7 @@
}
}
- totemrrp_initialize (
+ res = totemrrp_initialize (
poll_handle,
&instance->totemrrp_context,
totem_config,
@@ -1004,6 +1005,9 @@
main_token_seqid_get,
main_msgs_missing,
target_set_completed);
+ if (res == -1) {
+ goto error_exit;
+ }
/*
* Must have net_mtu adjusted by totemrrp_initialize first