summaryrefslogtreecommitdiffstats
path: root/schedutils
diff options
context:
space:
mode:
authorKarel Zak2011-03-03 15:00:30 +0100
committerKarel Zak2011-03-03 15:00:30 +0100
commit6c7d5ae9a2338be35cfab0fd8379a9f58c4f8c36 (patch)
treeb2e95024812c05b13b7102a104ff8277b61fe1f0 /schedutils
parentdocs: update TODO file (diff)
downloadkernel-qcow2-util-linux-6c7d5ae9a2338be35cfab0fd8379a9f58c4f8c36.tar.gz
kernel-qcow2-util-linux-6c7d5ae9a2338be35cfab0fd8379a9f58c4f8c36.tar.xz
kernel-qcow2-util-linux-6c7d5ae9a2338be35cfab0fd8379a9f58c4f8c36.zip
move struct option to .rodata
It does not make sense to have writable large arrays of "struct option" on the stack. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'schedutils')
-rw-r--r--schedutils/chrt.c2
-rw-r--r--schedutils/taskset.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/schedutils/chrt.c b/schedutils/chrt.c
index 489f29988..ce5d2ab71 100644
--- a/schedutils/chrt.c
+++ b/schedutils/chrt.c
@@ -189,7 +189,7 @@ int main(int argc, char *argv[])
struct sched_param sp;
pid_t pid = -1;
- struct option longopts[] = {
+ static const struct option longopts[] = {
{ "batch", 0, NULL, 'b' },
{ "fifo", 0, NULL, 'f' },
{ "idle", 0, NULL, 'i' },
diff --git a/schedutils/taskset.c b/schedutils/taskset.c
index 39b22452e..a861a9099 100644
--- a/schedutils/taskset.c
+++ b/schedutils/taskset.c
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
unsigned int ncpus;
size_t new_setsize, cur_setsize, cur_nbits, buflen;
- struct option longopts[] = {
+ static const struct option longopts[] = {
{ "pid", 0, NULL, 'p' },
{ "cpu-list", 0, NULL, 'c' },
{ "help", 0, NULL, 'h' },