wok-current diff busybox/stuff/busybox-1.23-losetup.u @ rev 19401
memtest: DOS shutdown (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Sep 03 13:03:50 2016 +0200 (2016-09-03) |
parents | |
children | 5a847ebc42a9 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/busybox-1.23-losetup.u Sat Sep 03 13:03:50 2016 +0200 1.3 @@ -0,0 +1,27 @@ 1.4 +keep previous default behaviour and display cloop devices 1.5 +--- busybox-1.23.0/util-linux/losetup.c 1.6 ++++ busybox-1.23.0/util-linux/losetup.c 1.7 +@@ -71,16 +71,20 @@ 1.8 + 1.9 + /* -a */ 1.10 +- if (opt == OPT_a) { 1.11 ++ if (opt == OPT_a || (!opt && !argv[0])) { 1.12 +- int n; 1.13 ++ int i, n; 1.14 ++ static char *fmt[3] = { LOOP_FORMAT, "/dev/cloop", "/dev/cloop%u" }; 1.15 ++ 1.16 ++ for (i = 0; i < 3; i++) 1.17 + for (n = 0; n < MAX_LOOP_NUM; n++) { 1.18 + char *s; 1.19 + 1.20 +- sprintf(dev, LOOP_FORMAT, n); 1.21 ++ sprintf(dev, fmt[i], n); 1.22 + s = query_loop(dev); 1.23 + if (s) { 1.24 + printf("%s: %s\n", dev, s); 1.25 + free(s); 1.26 + } 1.27 ++ if (i == 1) break; /* /dev/cloop */ 1.28 + } 1.29 + return EXIT_SUCCESS; 1.30 + }