wok annotate busybox/stuff/busybox-1.27-losetup.u @ rev 20308
Up slitaz-tools (1028)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed May 09 12:44:14 2018 +0200 (2018-05-09) |
parents | |
children |
rev | line source |
---|---|
pascal@19991 | 1 keep previous default behaviour and display cloop devices |
pascal@19991 | 2 --- busybox-1.26/util-linux/losetup.c |
pascal@19991 | 3 +++ busybox-1.26/util-linux/losetup.c |
pascal@19991 | 4 @@ -82,17 +82,21 @@ |
pascal@19991 | 5 } |
pascal@19991 | 6 |
pascal@19991 | 7 /* -a */ |
pascal@19991 | 8 - if (opt == OPT_a) { |
pascal@19991 | 9 - int n; |
pascal@19991 | 10 + if (opt == OPT_a || (!opt && !argv[0])) { |
pascal@19991 | 11 + int i, n; |
pascal@19991 | 12 + static const char *fmt[3] = { LOOP_FORMAT, "/dev/cloop", "/dev/cloop%u" }; |
pascal@19991 | 13 + |
pascal@19991 | 14 + for (i = 0; i < 3; i++) |
pascal@19991 | 15 for (n = 0; n < MAX_LOOP_NUM; n++) { |
pascal@19991 | 16 char *s; |
pascal@19991 | 17 |
pascal@19991 | 18 - sprintf(dev, LOOP_FORMAT, n); |
pascal@19991 | 19 + sprintf(dev, fmt[i], n); |
pascal@19991 | 20 s = query_loop(dev); |
pascal@19991 | 21 if (s) { |
pascal@19991 | 22 printf("%s: %s\n", dev, s); |
pascal@19991 | 23 free(s); |
pascal@19991 | 24 } |
pascal@19991 | 25 + if (i == 1) break; /* /dev/cloop */ |
pascal@19991 | 26 } |
pascal@19991 | 27 return EXIT_SUCCESS; |
pascal@19991 | 28 } |