summaryrefslogtreecommitdiffstats
path: root/mount/swapon.c
diff options
context:
space:
mode:
authorTobias Klauser2011-01-21 16:44:18 +0100
committerKarel Zak2011-01-31 16:13:16 +0100
commit16ff981363ca4b817276074b0684de910d1ef867 (patch)
tree6deb68ca69e66bf8d28cc404213483fac9ee88b8 /mount/swapon.c
parentprovide a workaround if program_invocation_short_name is missing (diff)
downloadkernel-qcow2-util-linux-16ff981363ca4b817276074b0684de910d1ef867.tar.gz
kernel-qcow2-util-linux-16ff981363ca4b817276074b0684de910d1ef867.tar.xz
kernel-qcow2-util-linux-16ff981363ca4b817276074b0684de910d1ef867.zip
swapon: make needlessly global variables static
Also constify the option array. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'mount/swapon.c')
-rw-r--r--mount/swapon.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/mount/swapon.c b/mount/swapon.c
index e9ccc94a3..2c0dd9fa3 100644
--- a/mount/swapon.c
+++ b/mount/swapon.c
@@ -58,18 +58,18 @@ enum {
#define SWAP_SIGNATURE "SWAPSPACE2"
#define SWAP_SIGNATURE_SZ (sizeof(SWAP_SIGNATURE) - 1)
-int all;
-int priority = -1; /* non-prioritized swap by default */
-int discard;
+static int all;
+static int priority = -1; /* non-prioritized swap by default */
+static int discard;
/* If true, don't complain if the device/file doesn't exist */
-int ifexists;
-int fixpgsz;
+static int ifexists;
+static int fixpgsz;
-int verbose;
-char *progname;
+static int verbose;
+static char *progname;
-static struct option longswaponopts[] = {
+static const struct option longswaponopts[] = {
/* swapon only */
{ "priority", required_argument, 0, 'p' },
{ "discard", 0, 0, 'd' },
@@ -84,7 +84,7 @@ static struct option longswaponopts[] = {
{ NULL, 0, 0, 0 }
};
-static struct option *longswapoffopts = &longswaponopts[4];
+static const struct option *longswapoffopts = &longswaponopts[4];
static int cannot_find(const char *special);