summaryrefslogtreecommitdiffstats
path: root/sys-utils
diff options
context:
space:
mode:
authorKarel Zak2011-03-03 15:00:30 +0100
committerKarel Zak2011-03-03 15:00:30 +0100
commit6c7d5ae9a2338be35cfab0fd8379a9f58c4f8c36 (patch)
treeb2e95024812c05b13b7102a104ff8277b61fe1f0 /sys-utils
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 'sys-utils')
-rw-r--r--sys-utils/fallocate.c2
-rw-r--r--sys-utils/fsfreeze.c2
-rw-r--r--sys-utils/fstrim.c2
-rw-r--r--sys-utils/lscpu.c2
-rw-r--r--sys-utils/setarch.c2
-rw-r--r--sys-utils/unshare.c2
6 files changed, 6 insertions, 6 deletions
diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c
index 74e9435fe..952dbcd1d 100644
--- a/sys-utils/fallocate.c
+++ b/sys-utils/fallocate.c
@@ -83,7 +83,7 @@ int main(int argc, char **argv)
loff_t length = -2LL;
loff_t offset = 0;
- struct option longopts[] = {
+ static const struct option longopts[] = {
{ "help", 0, 0, 'h' },
{ "keep-size", 0, 0, 'n' },
{ "offset", 1, 0, 'o' },
diff --git a/sys-utils/fsfreeze.c b/sys-utils/fsfreeze.c
index 2dab23f49..6ffd1b621 100644
--- a/sys-utils/fsfreeze.c
+++ b/sys-utils/fsfreeze.c
@@ -57,7 +57,7 @@ int main(int argc, char **argv)
char *path;
struct stat sb;
- struct option longopts[] = {
+ static const struct option longopts[] = {
{ "help", 0, 0, 'h' },
{ "freeze", 0, 0, 'f' },
{ "unfreeze", 0, 0, 'u' },
diff --git a/sys-utils/fstrim.c b/sys-utils/fstrim.c
index c7043a7c4..d4fb0c340 100644
--- a/sys-utils/fstrim.c
+++ b/sys-utils/fstrim.c
@@ -76,7 +76,7 @@ int main(int argc, char **argv)
struct fstrim_range range;
struct stat sb;
- struct option longopts[] = {
+ static const struct option longopts[] = {
{ "help", 0, 0, 'h' },
{ "offset", 1, 0, 'o' },
{ "length", 1, 0, 'l' },
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index 66c527dff..79c6857e2 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -925,7 +925,7 @@ int main(int argc, char *argv[])
struct lscpu_desc _desc, *desc = &_desc;
int parsable = 0, c, i, hex = 0;
- struct option longopts[] = {
+ static const struct option longopts[] = {
{ "help", no_argument, 0, 'h' },
{ "parse", no_argument, 0, 'p' },
{ "sysroot", required_argument, 0, 's' },
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
index 13b6fcd09..76f743fe5 100644
--- a/sys-utils/setarch.c
+++ b/sys-utils/setarch.c
@@ -84,7 +84,7 @@
/* Options --3gb and --4gb are for compatibitity with an old Debian setarch
implementation. */
-struct option longopts[] =
+static const struct option longopts[] =
{
{ "help", 0, 0, 'h' },
{ "verbose", 0, 0, 'v' },
diff --git a/sys-utils/unshare.c b/sys-utils/unshare.c
index 343a86ee3..7a68e2cbb 100644
--- a/sys-utils/unshare.c
+++ b/sys-utils/unshare.c
@@ -70,7 +70,7 @@ static void usage(int status)
int main(int argc, char *argv[])
{
- struct option longopts[] = {
+ static const struct option longopts[] = {
{ "help", no_argument, 0, 'h' },
{ "mount", no_argument, 0, 'm' },
{ "uts", no_argument, 0, 'u' },