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
From 8145ef83eb96a80dd452fec6d3530d946d562047 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Thu, 27 Sep 2018 16:09:54 -0700
Subject: [PATCH] blockdev: BLKRAGET returns 512-byte sectors.

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

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to