Kaynağa Gözat

notifyd: Check retval of corosync_cfg_initialize

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
(cherry picked from commit 844c8759d72637e1c7776d598744343ddee62e2e)
Jan Friesse 14 yıl önce
ebeveyn
işleme
19d6cee71b
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      tools/corosync-notifyd.c

+ 6 - 1
tools/corosync-notifyd.c

@@ -828,7 +828,12 @@ _cs_local_node_info_get(char **nodename, uint32_t *nodeid)
 	corosync_cfg_handle_t cfg_handle;
 
 	if (local_nodeid == 0) {
-		corosync_cfg_initialize(&cfg_handle, NULL);
+		rc = corosync_cfg_initialize(&cfg_handle, NULL);
+		if (rc != CS_OK) {
+			syslog (LOG_ERR, "Failed to initialize the cfg API. Error %d\n", rc);
+			exit (EXIT_FAILURE);
+		}
+
 		rc = corosync_cfg_local_get (cfg_handle, &local_nodeid);
 		corosync_cfg_finalize(cfg_handle);
 		if (rc != CS_OK) {