[PATCH] mdadm/mdopen: check system("modprobe ...") return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Build system gives an error with warn_unused_result, this should fix
that.
---
 mdopen.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mdopen.c b/mdopen.c
index dcdc6f2..8cd8507 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -313,7 +313,10 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
 			udev_block(devnm);
 		fd = open("/sys/module/md_mod/parameters/new_array", O_WRONLY);
 		if (fd < 0 && errno == ENOENT) {
-			system("modprobe md_mod");
+			if(system("modprobe md_mod")) {
+				pr_err("check modprobe md_mod results\n");
+				return -1;
+			}
 			fd = open("/sys/module/md_mod/parameters/new_array", O_WRONLY);
 		}
 		if (fd >= 0) {
-- 
2.14.1
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux