[Toybox] [PATCH] blockdev: BLKRAGET returns 512-byte sectors.

enh enh at google.com
Thu Sep 27 16:11:28 PDT 2018


Bug: https://github.com/landley/toybox/issues/104
---
 toys/other/blockdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toys/other/blockdev.c b/toys/other/blockdev.c
index e5fd0c3..c2e10a2 100644
--- a/toys/other/blockdev.c
+++ b/toys/other/blockdev.c
@@ -65,7 +65,7 @@ void blockdev_main(void)
       xioctl(fd, cmds[i], &val);

       flag &= FLAG_setbsz|FLAG_setro|FLAG_flushbufs|FLAG_rereadpt|FLAG_setrw|FLAG_setbsz;
-      if (!flag) printf("%lld\n", (toys.optflags &
(FLAG_getsz|FLAG_getra)) ? val >> 9: val);
+      if (!flag) printf("%lld\n", (toys.optflags & FLAG_getsz) ? val
>> 9: val);
     }
     xclose(fd);
   }
-- 
2.19.0.605.g01d371f741-goog
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-blockdev-BLKRAGET-returns-512-byte-sectors.patch
Type: text/x-patch
Size: 896 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20180927/8cc378d8/attachment-0002.bin>


More information about the Toybox mailing list