Просмотр исходного кода

Handle possible SA_AIS_ERR_TRY_AGAIN status.

(Logical change 1.152)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@536 fd59a12c-fef9-0310-b244-a6a79926bd2f
Mark Haverkamp 21 лет назад
Родитель
Сommit
6de1db9ba4
1 измененных файлов с 9 добавлено и 3 удалено
  1. 9 3
      test/publish.c

+ 9 - 3
test/publish.c

@@ -155,8 +155,10 @@ test_pub()
 		printf("Event Initialize result: %s\n", result_buf);
 		printf("Event Initialize result: %s\n", result_buf);
 		exit(result);
 		exit(result);
 	}
 	}
-	result = saEvtChannelOpen(handle, &channel_name, flags, 0,
+	do {
+		result = saEvtChannelOpen(handle, &channel_name, flags, 0,
 				&channel_handle);
 				&channel_handle);
+	} while (result == SA_AIS_ERR_TRY_AGAIN);
 	if (result != SA_AIS_OK) {
 	if (result != SA_AIS_OK) {
 		get_sa_error(result, result_buf, result_buf_len);
 		get_sa_error(result, result_buf, result_buf_len);
 		printf("channel open result: %s\n", result_buf);
 		printf("channel open result: %s\n", result_buf);
@@ -271,14 +273,18 @@ test_pub()
 		exit(result);
 		exit(result);
 	}
 	}
 
 
-	result = saEvtChannelClose(channel_handle);
+	do {
+		result = saEvtChannelClose(channel_handle);
+	} while (result == SA_AIS_ERR_TRY_AGAIN);
 	
 	
 	if (result != SA_AIS_OK) {
 	if (result != SA_AIS_OK) {
 		get_sa_error(result, result_buf, result_buf_len);
 		get_sa_error(result, result_buf, result_buf_len);
 		printf("channel close result: %s\n", result_buf);
 		printf("channel close result: %s\n", result_buf);
 		exit(result);
 		exit(result);
 	}
 	}
-	result = saEvtFinalize(handle);
+	do {
+		result = saEvtFinalize(handle);
+	} while (result == SA_AIS_ERR_TRY_AGAIN);
 
 
 	if (result != SA_AIS_OK) {
 	if (result != SA_AIS_OK) {
 		get_sa_error(result, result_buf, result_buf_len);
 		get_sa_error(result, result_buf, result_buf_len);