wok-current annotate busybox/stuff/busybox-1.23-losetup.u @ rev 18132
Add bcrelay
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jun 13 14:18:09 2015 +0200 (2015-06-13) |
parents | |
children | 5a847ebc42a9 |
rev | line source |
---|---|
pascal@17518 | 1 keep previous default behaviour and display cloop devices |
pascal@17518 | 2 --- busybox-1.23.0/util-linux/losetup.c |
pascal@17518 | 3 +++ busybox-1.23.0/util-linux/losetup.c |
pascal@17518 | 4 @@ -71,16 +71,20 @@ |
pascal@17518 | 5 |
pascal@17518 | 6 /* -a */ |
pascal@17518 | 7 - if (opt == OPT_a) { |
pascal@17518 | 8 + if (opt == OPT_a || (!opt && !argv[0])) { |
pascal@17518 | 9 - int n; |
pascal@17518 | 10 + int i, n; |
pascal@17518 | 11 + static char *fmt[3] = { LOOP_FORMAT, "/dev/cloop", "/dev/cloop%u" }; |
pascal@17518 | 12 + |
pascal@17518 | 13 + for (i = 0; i < 3; i++) |
pascal@17518 | 14 for (n = 0; n < MAX_LOOP_NUM; n++) { |
pascal@17518 | 15 char *s; |
pascal@17518 | 16 |
pascal@17518 | 17 - sprintf(dev, LOOP_FORMAT, n); |
pascal@17518 | 18 + sprintf(dev, fmt[i], n); |
pascal@17518 | 19 s = query_loop(dev); |
pascal@17518 | 20 if (s) { |
pascal@17518 | 21 printf("%s: %s\n", dev, s); |
pascal@17518 | 22 free(s); |
pascal@17518 | 23 } |
pascal@17518 | 24 + if (i == 1) break; /* /dev/cloop */ |
pascal@17518 | 25 } |
pascal@17518 | 26 return EXIT_SUCCESS; |
pascal@17518 | 27 } |