wok view busybox/stuff/busybox-1.23-losetup.u @ rev 19986
Add hgfse
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jul 01 16:57:19 2017 +0200 (2017-07-01) |
parents | 4a9f656c414b |
children |
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 const 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 }