aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2023-12-14 09:45:05 +0100
committerKarel Zak <kzak@redhat.com>2023-12-14 09:45:05 +0100
commit2f252cc8b19d96085c691ba75ed0ca3f2ae3aa7d (patch)
treed430f554a5e40c6a8d76e48ba9d4634a23ba029a
parentfff33391c83507c663ea9d361cbbf09b7620da8a (diff)
parentd546d7516d481a9bcff3e2db852ef1b999825ece (diff)
downloadutil-linux-2f252cc8b19d96085c691ba75ed0ca3f2ae3aa7d.tar.gz
Merge branch 'fix-getsz-verbose-output' of https://github.com/calestyo/util-linux
* 'fix-getsz-verbose-output' of https://github.com/calestyo/util-linux: blockdev: add missing verbose output for --getsz
-rw-r--r--disk-utils/blockdev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c
index 92c02602b7..242d11638a 100644
--- a/disk-utils/blockdev.c
+++ b/disk-utils/blockdev.c
@@ -347,8 +347,11 @@ static void do_commands(int fd, char **argv, int d)
if (!strcmp(argv[i], "--getsz")) {
res = blkdev_get_sectors(fd, &llu);
- if (res == 0)
+ if (res == 0) {
+ if (verbose)
+ printf(_("get size in 512-byte sectors: "));
printf("%lld\n", llu);
+ }
else
errx(EXIT_FAILURE,
_("could not get device size"));