mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 00:55:11 +00:00
losetup: use /dev/loopN or /dev/loop/N according to CONFIG_FEATURE_DEVFS=n/y
This commit is contained in:
parent
a959588b80
commit
0b193a7871
@ -442,6 +442,7 @@ extern int bb_default_error_retval;
|
|||||||
#endif
|
#endif
|
||||||
# define VC_FORMAT "/dev/vc/%d"
|
# define VC_FORMAT "/dev/vc/%d"
|
||||||
# define LOOP_FORMAT "/dev/loop/%d"
|
# define LOOP_FORMAT "/dev/loop/%d"
|
||||||
|
# define LOOP_NAME "/dev/loop/"
|
||||||
# define FB_0 "/dev/fb/0"
|
# define FB_0 "/dev/fb/0"
|
||||||
#else
|
#else
|
||||||
# define CURRENT_VC "/dev/tty0"
|
# define CURRENT_VC "/dev/tty0"
|
||||||
@ -461,6 +462,7 @@ extern int bb_default_error_retval;
|
|||||||
#endif
|
#endif
|
||||||
# define VC_FORMAT "/dev/tty%d"
|
# define VC_FORMAT "/dev/tty%d"
|
||||||
# define LOOP_FORMAT "/dev/loop%d"
|
# define LOOP_FORMAT "/dev/loop%d"
|
||||||
|
# define LOOP_NAME "/dev/loop"
|
||||||
# define FB_0 "/dev/fb0"
|
# define FB_0 "/dev/fb0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -48,11 +48,11 @@ int losetup_main(int argc, char **argv)
|
|||||||
printf("%s: %s\n", argv[0], s);
|
printf("%s: %s\n", argv[0], s);
|
||||||
if (ENABLE_FEATURE_CLEAN_UP) free(s);
|
if (ENABLE_FEATURE_CLEAN_UP) free(s);
|
||||||
} else {
|
} else {
|
||||||
char dev[11] = "/dev/loop0";
|
char dev[sizeof(LOOP_NAME"0")] = LOOP_NAME"0";
|
||||||
char c;
|
char c;
|
||||||
for (c = '0'; c <= '9'; ++c) {
|
for (c = '0'; c <= '9'; ++c) {
|
||||||
char *s;
|
char *s;
|
||||||
dev[9] = c;
|
dev[sizeof(LOOP_NAME"0")-2] = c;
|
||||||
s = query_loop(dev);
|
s = query_loop(dev);
|
||||||
if (s) {
|
if (s) {
|
||||||
printf("%s: %s\n", dev, s);
|
printf("%s: %s\n", dev, s);
|
||||||
|
Loading…
Reference in New Issue
Block a user