diff options
author | Bernd Schubert <bernd.schubert@itwm.fraunhofer.de> | 2013-06-18 11:09:16 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-06-19 10:03:12 +1000 |
commit | f8fcf7a1c54c7c6b9b75a3388a73435db198bd71 (patch) | |
tree | d3d71d012edc868a8883c82415a4b5648cb51b73 /lib.c | |
parent | 7506f86012f1924caa7dca167445bbc7392362c3 (diff) |
raid6check: Fix build of raid6check
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 <bernd.schubert@itwm.fraunhofer.de>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; |