[Toybox] [patch] makedevs - naming device issue

김혜진 hj8296 at gmail.com
Mon Apr 20 03:35:09 PDT 2015


Hi.

On the way to create makedevs.test, I found naming differs from busybox if
the count is 1.
For example, Stdin for makedevs is "AAA c 1 0 0 2 5 0 0 1"
And it makes AAA0 device instead of AAA. (Busybox makes AAA in this case)
I'm not sure which one is correct, but think operation should follow common
way.


diff --git a/toys/other/makedevs.c b/toys/other/makedevs.c
index 0d20a57..4b6b4b7 100644
--- a/toys/other/makedevs.c
+++ b/toys/other/makedevs.c
@@ -84,7 +84,7 @@ void makedevs_main()
     while (*node == '/') node++; // using relative path

     for (i = 0; (!cnt && !i) || i < cnt; i++) {
-      if (cnt) {
+      if (cnt > 1) {
         snprintf(toybuf, sizeof(toybuf), "%s%u", node, st_val + i);
         ptr = toybuf;
       } else ptr = node;
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20150420/a4268bb6/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-makedevs-creating-device-name-with-devname-no-format.patch
Type: application/octet-stream
Size: 801 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20150420/a4268bb6/attachment-0004.obj>


More information about the Toybox mailing list