wok annotate busybox/stuff/busybox-1.31-losetup.u @ rev 24021

busybox: fix busybox-1.31-stat.u
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Mar 06 18:53:34 2021 +0000 (2021-03-06)
parents
children
rev   line source
pascal@21761 1 keep previous default behaviour and display cloop devices
pascal@21761 2 --- busybox-1.31/util-linux/losetup.c
pascal@21761 3 +++ busybox-1.31/util-linux/losetup.c
pascal@21761 4 @@ -96,17 +96,21 @@
pascal@21761 5 }
pascal@21761 6
pascal@21761 7 /* -a */
pascal@21761 8 - if (opt == OPT_a) {
pascal@21761 9 - int n;
pascal@21761 10 + if (opt == OPT_a || (!opt && !argv[0])) {
pascal@21761 11 + int i, n;
pascal@21761 12 + static const char *fmt[3] = { LOOP_FORMAT, "/dev/cloop", "/dev/cloop%u" };
pascal@21761 13 +
pascal@21761 14 + for (i = 0; i < 3; i++)
pascal@21761 15 for (n = 0; n < MAX_LOOP_NUM; n++) {
pascal@21761 16 char *s;
pascal@21761 17
pascal@21761 18 - sprintf(dev, LOOP_FORMAT, n);
pascal@21761 19 + sprintf(dev, fmt[i], n);
pascal@21761 20 s = query_loop(dev);
pascal@21761 21 if (s) {
pascal@21761 22 printf("%s: %s\n", dev, s);
pascal@21761 23 free(s);
pascal@21761 24 }
pascal@21761 25 + if (i == 1) break; /* /dev/cloop */
pascal@21761 26 }
pascal@21761 27 return EXIT_SUCCESS;
pascal@21761 28 }