From 9f376da6439b07dc93ae084ab576e133b9d8d839 Mon Sep 17 00:00:00 2001 From: Mateusz Grzonka Date: Tue, 21 Nov 2023 01:58:24 +0100 Subject: udev: Move udev_block() and udev_unblock() into udev.c Add kernel style comments and better error handling. Signed-off-by: Mateusz Grzonka Signed-off-by: Kinga Tanska Signed-off-by: Jes Sorensen --- mdopen.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mdopen.c') diff --git a/mdopen.c b/mdopen.c index f9b04e1c..eaa59b59 100644 --- a/mdopen.c +++ b/mdopen.c @@ -336,8 +336,8 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy, devnm[0] = 0; if (num < 0 && cname && ci->names) { sprintf(devnm, "md_%s", cname); - if (block_udev) - udev_block(devnm); + if (block_udev && udev_block(devnm) != UDEV_STATUS_SUCCESS) + return -1; if (!create_named_array(devnm)) { devnm[0] = 0; udev_unblock(); @@ -345,8 +345,8 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy, } if (num >= 0) { sprintf(devnm, "md%d", num); - if (block_udev) - udev_block(devnm); + if (block_udev && udev_block(devnm) != UDEV_STATUS_SUCCESS) + return -1; if (!create_named_array(devnm)) { devnm[0] = 0; udev_unblock(); @@ -369,8 +369,8 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy, return -1; } } - if (block_udev) - udev_block(devnm); + if (block_udev && udev_block(devnm) != UDEV_STATUS_SUCCESS) + return -1; create_named_array(devnm); } -- cgit v1.2.3