소스 검색

Patches from Mathieu.Marie@sun.com:
2- On Solaris, the SA components executed have no names.
3- When killing the testamf1 component, it makes the aisexec process
crash on both of my nodes.
4- max priority for RR on solaris is 59.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1247 fd59a12c-fef9-0310-b244-a6a79926bd2f

Hans Feldt 19 년 전
부모
커밋
40066857bf
3개의 변경된 파일16개의 추가작업 그리고 10개의 파일을 삭제
  1. 1 1
      exec/openais-instantiate.c
  2. 1 1
      test/clc_cli_script
  3. 14 8
      test/testamf1.c

+ 1 - 1
exec/openais-instantiate.c

@@ -96,7 +96,7 @@ int main (int argc, char **argv, char **envp)
 		/*
 		 * child process
 		 */
-		res = execve (argv[1], &argv[2], envp);
+		res = execve (argv[1], &argv[1], envp);
 		if (res == -1) {
 			return (errno);
 		}

+ 1 - 1
test/clc_cli_script

@@ -60,7 +60,7 @@ cleanup() {
 #	`cat $PIDFILEPATH/openais_cleanup_$SA_AMF_COMPONENT_NAME`
 	kill -9 `cat $PIDFILEPATH/openais_cleanup_$SA_AMF_COMPONENT_NAME`
 	STATUS=$?
-	if [ $STATUS == 1 ]; then
+	if [ $STATUS -eq 1 ]; then
 		exit 0
 	else
 		exit $STATUS

+ 14 - 8
test/testamf1.c

@@ -298,11 +298,8 @@ SaAmfCallbacksT amfCallbacks = {
 SaAmfCallbacksT amfCallbacks;
 
 SaVersionT version = { 'B', 1, 1 };
-
 #if ! defined(TS_CLASS) && (defined(OPENAIS_BSD) || defined(OPENAIS_LINUX) || defined(OPENAIS_SOLARIS))
-static struct sched_param sched_param = {
-    sched_priority: 99
-};
+static struct sched_param sched_param;
 #endif
 
 void sigintr_handler (int signum) {
@@ -377,10 +374,19 @@ int main (int argc, char **argv)
 	signal (SIGUSR2, sigusr2_handler);
 
 #if ! defined(TS_CLASS) && (defined(OPENAIS_BSD) || defined(OPENAIS_LINUX) || defined(OPENAIS_SOLARIS))
-	result = sched_setscheduler (0, SCHED_RR, &sched_param);
-	if (result == -1) {
-		fprintf (stderr, "%d: couldn't set sched priority\n", (int)getpid());
- 	}
+
+	sched_param.sched_priority = sched_get_priority_max(SCHED_RR);
+	if (sched_param.sched_priority == -1) {
+		fprintf (stderr, "%d: couldn't retrieve the maximum scheduling " \
+		    "priority supported by the Round-Robin class (%s)\n",
+		    (int)getpid(), strerror(errno));
+	} else {
+		result = sched_setscheduler (0, SCHED_RR, &sched_param);
+		if (result == -1) {
+			fprintf (stderr, "%d: couldn't set sched priority (%s)\n",
+			    (int)getpid(), strerror(errno));
+		}
+	}
 #endif
 
 	do {