summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko2010-04-14 13:52:41 -0700
committerDenys Vlasenko2010-04-14 13:52:41 -0700
commitb9dd5ab6d954d0a6fd3813191a2ff2844347c54c (patch)
tree07cb07e7bccf7148ae9919616f1c1e68430861d2 /libbb
parent351ef7188a1a2e2f154bbda6f703c2d3f4af6d79 (diff)
downloadbusybox-b9dd5ab6d954d0a6fd3813191a2ff2844347c54c.zip
busybox-b9dd5ab6d954d0a6fd3813191a2ff2844347c54c.tar.gz
loop: correct minor device number limit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/loop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/loop.c b/libbb/loop.c
index 204fcc9..b69d9d9 100644
--- a/libbb/loop.c
+++ b/libbb/loop.c
@@ -104,7 +104,8 @@ int FAST_FUNC set_loop(char **device, const char *file, unsigned long long offse
/* Find a loop device. */
try = *device ? *device : dev;
- for (i = 0; rc && i < 256; i++) {
+ /* 1048575 is a max possible minor number in Linux circa 2010 */
+ for (i = 0; rc && i < 1048576; i++) {
sprintf(dev, LOOP_FORMAT, i);
IF_FEATURE_MOUNT_LOOP_CREATE(errno = 0;)