wok-6.x annotate busybox/stuff/busybox-1.25-losetup.u @ rev 19568

Up qt4 (4.8.7)
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Thu Dec 22 15:11:17 2016 +0100 (2016-12-22)
parents
children
rev   line source
pascal@19340 1 keep previous default behaviour and display cloop devices
pascal@19340 2 --- busybox-1.25/util-linux/losetup.c
pascal@19340 3 +++ busybox-1.25/util-linux/losetup.c
pascal@19340 4 @@ -70,17 +70,21 @@
pascal@19340 5 }
pascal@19340 6
pascal@19340 7 /* -a */
pascal@19340 8 - if (opt == OPT_a) {
pascal@19340 9 - int n;
pascal@19340 10 + if (opt == OPT_a || (!opt && !argv[0])) {
pascal@19340 11 + int i, n;
pascal@19340 12 + static char *fmt[3] = { LOOP_FORMAT, "/dev/cloop", "/dev/cloop%u" };
pascal@19340 13 +
pascal@19340 14 + for (i = 0; i < 3; i++)
pascal@19340 15 for (n = 0; n < MAX_LOOP_NUM; n++) {
pascal@19340 16 char *s;
pascal@19340 17
pascal@19340 18 - sprintf(dev, LOOP_FORMAT, n);
pascal@19340 19 + sprintf(dev, fmt[i], n);
pascal@19340 20 s = query_loop(dev);
pascal@19340 21 if (s) {
pascal@19340 22 printf("%s: %s\n", dev, s);
pascal@19340 23 free(s);
pascal@19340 24 }
pascal@19340 25 + if (i == 1) break; /* /dev/cloop */
pascal@19340 26 }
pascal@19340 27 return EXIT_SUCCESS;
pascal@19340 28 }