wok view busybox/stuff/busybox-1.23-losetup.u @ rev 18383

linux64-aufs: add 3.2.71 patch
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 18 09:16:57 2015 +0200 (2015-09-18)
parents
children 5a847ebc42a9
line source
1 keep previous default behaviour and display cloop devices
2 --- busybox-1.23.0/util-linux/losetup.c
3 +++ busybox-1.23.0/util-linux/losetup.c
4 @@ -71,16 +71,20 @@
6 /* -a */
7 - if (opt == OPT_a) {
8 + if (opt == OPT_a || (!opt && !argv[0])) {
9 - int n;
10 + int i, n;
11 + static char *fmt[3] = { LOOP_FORMAT, "/dev/cloop", "/dev/cloop%u" };
12 +
13 + for (i = 0; i < 3; i++)
14 for (n = 0; n < MAX_LOOP_NUM; n++) {
15 char *s;
17 - sprintf(dev, LOOP_FORMAT, n);
18 + sprintf(dev, fmt[i], n);
19 s = query_loop(dev);
20 if (s) {
21 printf("%s: %s\n", dev, s);
22 free(s);
23 }
24 + if (i == 1) break; /* /dev/cloop */
25 }
26 return EXIT_SUCCESS;
27 }