Thread (21 messages) 21 messages, 3 authors, 2013-06-28
STALE4744d

[PATCH 1/6] raid6check: Fix build of raid6check

From: Bernd Schubert <hidden>
Date: 2013-06-18 09:09:16
Subsystem: the rest · Maintainer: Linus Torvalds

After recent git pull 'make raid6check' did not work anymore, as
sysfs_read() was called with a wrong argument and as check_env()
was used by use_udev(), but not defined.


Replace sysfs_read(..., -1, ...) by sysfs_read(..., NULL, ...)

Move check_env() from util.c to lib.c

Signed-off-by: Bernd Schubert <redacted>
---
 lib.c        |   10 ++++++++++
 raid6check.c |    2 +-
 util.c       |   10 ----------
 3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/lib.c b/lib.c
index 1958029..2c3d936 100644
--- a/lib.c
+++ b/lib.c
@@ -378,6 +378,16 @@ void print_escape(char *str)
 	}
 }
 
+int check_env(char *name)
+{
+	char *val = getenv(name);
+
+	if (val && atoi(val) == 1)
+		return 1;
+
+	return 0;
+}
+
 int use_udev(void)
 {
 	static int use = -1;
diff --git a/raid6check.c b/raid6check.c
index e9a17a7..f5aeee4 100644
--- a/raid6check.c
+++ b/raid6check.c
@@ -386,7 +386,7 @@ int main(int argc, char *argv[])
 		goto exitHere;
 	}
 
-	info = sysfs_read(mdfd, -1,
+	info = sysfs_read(mdfd, NULL,
 			  GET_LEVEL|
 			  GET_LAYOUT|
 			  GET_DISKS|
diff --git a/util.c b/util.c
index 3ac63e3..7da69ac 100644
--- a/util.c
+++ b/util.c
@@ -1798,16 +1798,6 @@ int start_mdmon(char *devnm)
 	return 0;
 }
 
-int check_env(char *name)
-{
-	char *val = getenv(name);
-
-	if (val && atoi(val) == 1)
-		return 1;
-
-	return 0;
-}
-
 __u32 random32(void)
 {
 	__u32 rv;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help