← Commit list

0b193a787

Denis Vlasenko
Denis Vlasenko
2006-09-29
SOURCE BUG Duration: 55s

Subject

losetup: use /dev/loopN or /dev/loop/N according to CONFIG_FEATURE_DEVFS=n/y

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

include/libbb.h+2 -0
@@ -442,6 +442,7 @@ extern int bb_default_error_retval;
#endif
# define VC_FORMAT "/dev/vc/%d"
# define LOOP_FORMAT "/dev/loop/%d"
+# define LOOP_NAME "/dev/loop/"
# define FB_0 "/dev/fb/0"
#else
# define CURRENT_VC "/dev/tty0"
@@ -461,6 +462,7 @@ extern int bb_default_error_retval;
#endif
# define VC_FORMAT "/dev/tty%d"
# define LOOP_FORMAT "/dev/loop%d"
+# define LOOP_NAME "/dev/loop"
# define FB_0 "/dev/fb0"
#endif
util-linux/losetup.c+2 -2
@@ -48,11 +48,11 @@ int losetup_main(int argc, char **argv)
printf("%s: %s\n", argv[0], s);
if (ENABLE_FEATURE_CLEAN_UP) free(s);
} else {
- char dev[11] = "/dev/loop0";
+ char dev[sizeof(LOOP_NAME"0")] = LOOP_NAME"0";
char c;
for (c = '0'; c <= '9'; ++c) {
char *s;
- dev[9] = c;
+ dev[sizeof(LOOP_NAME"0")-2] = c;
s = query_loop(dev);
if (s) {
printf("%s: %s\n", dev, s);