wok-current annotate busybox/stuff/busybox-1.30-losetup.u @ rev 21273

updated libplist and libplist-dev (1.4.0 -> 2.0.0)
author Hans-G?nter Theisgen
date Fri Apr 12 17:10:00 2019 +0100 (2019-04-12)
parents
children
rev   line source
pascal@20652 1 keep previous default behaviour and display cloop devices
pascal@20652 2 --- busybox-1.30/util-linux/losetup.c
pascal@20652 3 +++ busybox-1.30/util-linux/losetup.c
pascal@20652 4 @@ -81,17 +81,21 @@
pascal@20652 5 }
pascal@20652 6
pascal@20652 7 /* -a */
pascal@20652 8 - if (opt == OPT_a) {
pascal@20652 9 - int n;
pascal@20652 10 + if (opt == OPT_a || (!opt && !argv[0])) {
pascal@20652 11 + int i, n;
pascal@20652 12 + static const char *fmt[3] = { LOOP_FORMAT, "/dev/cloop", "/dev/cloop%u" };
pascal@20652 13 +
pascal@20652 14 + for (i = 0; i < 3; i++)
pascal@20652 15 for (n = 0; n < MAX_LOOP_NUM; n++) {
pascal@20652 16 char *s;
pascal@20652 17
pascal@20652 18 - sprintf(dev, LOOP_FORMAT, n);
pascal@20652 19 + sprintf(dev, fmt[i], n);
pascal@20652 20 s = query_loop(dev);
pascal@20652 21 if (s) {
pascal@20652 22 printf("%s: %s\n", dev, s);
pascal@20652 23 free(s);
pascal@20652 24 }
pascal@20652 25 + if (i == 1) break; /* /dev/cloop */
pascal@20652 26 }
pascal@20652 27 return EXIT_SUCCESS;
pascal@20652 28 }