Browse Source

examples/sched_ctx/sched_ctx_without_sched_policy.c: fix case when there is only 1 CPU, it is shared between both contexts

Nathalie Furmento 11 years ago
parent
commit
f2b00293d8
1 changed files with 1 additions and 8 deletions
  1. 1 8
      examples/sched_ctx/sched_ctx_without_sched_policy.c

+ 1 - 8
examples/sched_ctx/sched_ctx_without_sched_policy.c

@@ -101,17 +101,10 @@ int main(int argc, char **argv)
 	}
 	else
 	{
-		procs1 = (int*)malloc(nprocs1*sizeof(int));
 		procs2 = (int*)malloc(nprocs2*sizeof(int));
-		procs1[0] = 0;
-		procs2[0] = 0;
+		procs2[0] = procs1[0];
 
 	}
-#else
-	procs1 = (int*)malloc(nprocs1*sizeof(int));
-	procs2 = (int*)malloc(nprocs2*sizeof(int));
-	procs1[0] = 0;
-	procs2[0] = 0;
 #endif
 
 	if (ncpus == 0) goto enodev;