diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-07-20 13:05:44 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-07-20 13:05:44 -0400 |
commit | f737155afa79628d218c5ad413f7957a60a43d74 (patch) | |
tree | 32b8e69efb4d03a5414ee6b0751faad84f842f44 | |
parent | 6bf659fd920e06480011f70d819338b3b4b95bba (diff) |
Make sure scheduling parameter struct is zeroed out
-rw-r--r-- | src/task.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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(¶m, 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 */ |