From 5c7454176ef1914d723a62c3d424be1913b51a97 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 14 Apr 2017 20:40:50 -0800 Subject: cmd_list improvements; use %m --- linux/blkdev.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'linux') diff --git a/linux/blkdev.c b/linux/blkdev.c index 93459d0b..c72df60f 100644 --- a/linux/blkdev.c +++ b/linux/blkdev.c @@ -23,8 +23,7 @@ int submit_bio_wait(struct bio *bio) if (bio->bi_opf & REQ_PREFLUSH) { ret = fdatasync(bio->bi_bdev->bd_fd); if (ret) { - fprintf(stderr, "fsync error: %s\n", - strerror(errno)); + fprintf(stderr, "fsync error: %m\n"); return -EIO; } } @@ -56,16 +55,14 @@ int submit_bio_wait(struct bio *bio) } if (ret != bio->bi_iter.bi_size) { - fprintf(stderr, "IO error: %li (%s)\n", - ret, strerror(errno)); + fprintf(stderr, "IO error: %li (%m)\n", ret); return -EIO; } if (bio->bi_opf & REQ_FUA) { ret = fdatasync(bio->bi_bdev->bd_fd); if (ret) { - fprintf(stderr, "fsync error: %s\n", - strerror(errno)); + fprintf(stderr, "fsync error: %m\n"); return -EIO; } } -- cgit v1.2.3