wok-next diff busybox/stuff/1.26/losetup.u @ rev 19596
Busybox: revert last commit, up to 1.26.2, use Pascal's patches, disable modules-init-tools and dpkg applets.
No pam, no uclibc, no musl, no dietlibc here. Just plain busybox. Prepare other versions in the respective packages (TODO).
No pam, no uclibc, no musl, no dietlibc here. Just plain busybox. Prepare other versions in the respective packages (TODO).
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sun Jan 22 06:14:23 2017 +0200 (2017-01-22) |
parents | busybox/stuff/busybox-1.26-losetup.u@4c6c19c4bc38 |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/1.26/losetup.u Sun Jan 22 06:14:23 2017 +0200 1.3 @@ -0,0 +1,28 @@ 1.4 +keep previous default behaviour and display cloop devices 1.5 +--- busybox-1.26/util-linux/losetup.c 1.6 ++++ busybox-1.26/util-linux/losetup.c 1.7 +@@ -82,17 +82,21 @@ 1.8 + } 1.9 + 1.10 + /* -a */ 1.11 +- if (opt == OPT_a) { 1.12 +- int n; 1.13 ++ if (opt == OPT_a || (!opt && !argv[0])) { 1.14 ++ int i, n; 1.15 ++ static const char *fmt[3] = { LOOP_FORMAT, "/dev/cloop", "/dev/cloop%u" }; 1.16 ++ 1.17 ++ for (i = 0; i < 3; i++) 1.18 + for (n = 0; n < MAX_LOOP_NUM; n++) { 1.19 + char *s; 1.20 + 1.21 +- sprintf(dev, LOOP_FORMAT, n); 1.22 ++ sprintf(dev, fmt[i], n); 1.23 + s = query_loop(dev); 1.24 + if (s) { 1.25 + printf("%s: %s\n", dev, s); 1.26 + free(s); 1.27 + } 1.28 ++ if (i == 1) break; /* /dev/cloop */ 1.29 + } 1.30 + return EXIT_SUCCESS; 1.31 + }