wok-next view 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).
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 source
1 keep previous default behaviour and display cloop devices
2 --- busybox-1.26/util-linux/losetup.c
3 +++ busybox-1.26/util-linux/losetup.c
4 @@ -82,17 +82,21 @@
5 }
7 /* -a */
8 - if (opt == OPT_a) {
9 - int n;
10 + if (opt == OPT_a || (!opt && !argv[0])) {
11 + int i, n;
12 + static const char *fmt[3] = { LOOP_FORMAT, "/dev/cloop", "/dev/cloop%u" };
13 +
14 + for (i = 0; i < 3; i++)
15 for (n = 0; n < MAX_LOOP_NUM; n++) {
16 char *s;
18 - sprintf(dev, LOOP_FORMAT, n);
19 + sprintf(dev, fmt[i], n);
20 s = query_loop(dev);
21 if (s) {
22 printf("%s: %s\n", dev, s);
23 free(s);
24 }
25 + if (i == 1) break; /* /dev/cloop */
26 }
27 return EXIT_SUCCESS;
28 }