wok-6.x annotate busybox/stuff/busybox-1.32-losetup.u @ rev 25493

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