aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-07-20 13:05:44 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2015-07-20 13:05:44 -0400
commitf737155afa79628d218c5ad413f7957a60a43d74 (patch)
tree32b8e69efb4d03a5414ee6b0751faad84f842f44
parent6bf659fd920e06480011f70d819338b3b4b95bba (diff)
Make sure scheduling parameter struct is zeroed out
-rw-r--r--src/task.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/task.c b/src/task.c
index 3e3950c..130406b 100644
--- a/src/task.c
+++ b/src/task.c
@@ -1,4 +1,5 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <string.h>
2#include <stdio.h> 3#include <stdio.h>
3#include <unistd.h> 4#include <unistd.h>
4#include <errno.h> 5#include <errno.h>
@@ -17,6 +18,7 @@ int task_mode(int mode)
17 int policy = sched_getscheduler(gettid()); 18 int policy = sched_getscheduler(gettid());
18 int old_mode = policy == SCHED_LITMUS ? LITMUS_RT_TASK : BACKGROUND_TASK; 19 int old_mode = policy == SCHED_LITMUS ? LITMUS_RT_TASK : BACKGROUND_TASK;
19 20
21 memset(&param, sizeof(param), 0);
20 param.sched_priority = 0; 22 param.sched_priority = 0;
21 if (old_mode == LITMUS_RT_TASK && mode == BACKGROUND_TASK) { 23 if (old_mode == LITMUS_RT_TASK && mode == BACKGROUND_TASK) {
22 /* transition to normal task */ 24 /* transition to normal task */