util-linux/0003-swapon-remove-loop-dec...

38 lines
1.2 KiB
Diff

From 10a9cbcf36d43c0d4a13bf5e91315b4ffd29e636 Mon Sep 17 00:00:00 2001
From: Sami Kerola <kerolasa@iki.fi>
Date: Mon, 8 Oct 2012 08:08:20 +0100
Subject: [PATCH 03/11] swapon: remove loop declaration [smatch scan]
sys-utils/swapon.c:677:2: error: 'for' loop initial declarations are
only allowed in C99 mode
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
sys-utils/swapon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c
index c9cabc1..0e1ab66 100644
--- a/sys-utils/swapon.c
+++ b/sys-utils/swapon.c
@@ -642,6 +642,7 @@ static int swapon_all(void)
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
+ size_t i;
fputs(USAGE_HEADER, out);
fprintf(out, _(" %s [options] [<spec>]\n"), program_invocation_short_name);
@@ -674,7 +675,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
" <file> name of file to be used\n"), out);
fputs(_("\nAvailable columns (for --show):\n"), out);
- for (size_t i = 0; i < NCOLS; i++)
+ for (i = 0; i < NCOLS; i++)
fprintf(out, " %4s %s\n", infos[i].name, _(infos[i].help));
fprintf(out, USAGE_MAN_TAIL("swapon(8)"));
--
1.7.11.7