From 40fea6d7ef06b7f278bf3c3c270f1c1a8f58b26c Mon Sep 17 00:00:00 2001 From: Packit Service Date: Feb 24 2021 16:07:43 +0000 Subject: Apply patch 0060-kpartx-free-loop-device-after-listing-partitions.patch patch_name: 0060-kpartx-free-loop-device-after-listing-partitions.patch present_in_specfile: true location_in_specfile: 60 --- diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c index 653ce0c..a337a07 100644 --- a/kpartx/kpartx.c +++ b/kpartx/kpartx.c @@ -407,7 +407,7 @@ main(int argc, char **argv){ fprintf(stderr, "can't del loop : %s\n", loopdev); r = 1; - } else + } else if (verbose) fprintf(stderr, "loop deleted : %s\n", loopdev); } goto end; @@ -649,16 +649,17 @@ main(int argc, char **argv){ if (n > 0) break; } - if (what == LIST && loopcreated && S_ISREG (buf.st_mode)) { + if (what == LIST && loopcreated) { if (fd != -1) close(fd); if (del_loop(device)) { if (verbose) - printf("can't del loop : %s\n", + fprintf(stderr, "can't del loop : %s\n", device); exit(1); } - printf("loop deleted : %s\n", device); + if (verbose) + fprintf(stderr, "loop deleted : %s\n", device); } end: