From: Karel Zak Date: Thu, 16 Oct 2025 09:22:47 +0000 (+0200) Subject: losetup: add error feedback for --remove command X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b62b2dd72d4f004e66234cc63abf8da94e1926e;p=thirdparty%2Futil-linux.git losetup: add error feedback for --remove command The remove_loop() function was silently failing without providing any feedback to the user. This also fixes incorrect indentation (spaces instead of tabs). Signed-off-by: Karel Zak Reported-by: Benno Schulenberg --- diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index faab3934b..d694190be 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -262,9 +262,11 @@ static int detach_all_loops(struct loopdev_cxt *lc) static int remove_loop(struct loopdev_cxt *lc) { - if (loopcxt_remove_device(lc)) - return -1; - return 0; + if (loopcxt_remove_device(lc)) { + warn(_("%s: remove failed"), loopcxt_get_device(lc)); + return -1; + } + return 0; } static int set_scols_data(struct loopdev_cxt *lc, struct libscols_line *ln)