From 7b62b2dd72d4f004e66234cc63abf8da94e1926e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 16 Oct 2025 11:22:47 +0200 Subject: [PATCH] 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 --- sys-utils/losetup.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) -- 2.47.3