← Commit list

a52145a92

Denis Vlasenko
Denis Vlasenko
2006-09-17
SOURCE BUG Duration: 94s

Subject

mount: mount_it_now() - char *dir is not really needed.

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 →

util-linux/mount.c+3 -3
@@ -253,7 +253,7 @@ static int mount_it_now(struct mntent *mp, int vfsflags, char *filteropts)
* mtab file by hand, add the new entry to it now. */
if (ENABLE_FEATURE_MTAB_SUPPORT && useMtab && !rc && !(vfsflags & MS_REMOUNT)) {
- char *dir,*fsname;
+ char *fsname;
FILE *mountTable = setmntent(bb_path_mtab_file, "a+");
int i;
@@ -273,7 +273,7 @@ static int mount_it_now(struct mntent *mp, int vfsflags, char *filteropts)
// Convert to canonical pathnames as needed
- mp->mnt_dir = dir = bb_simplify_path(mp->mnt_dir);
+ mp->mnt_dir = bb_simplify_path(mp->mnt_dir);
fsname = 0;
if (!mp->mnt_type || !*mp->mnt_type) { /* bind mount */
mp->mnt_fsname = fsname = bb_simplify_path(mp->mnt_fsname);
@@ -286,7 +286,7 @@ static int mount_it_now(struct mntent *mp, int vfsflags, char *filteropts)
addmntent(mountTable, mp);
endmntent(mountTable);
if (ENABLE_FEATURE_CLEAN_UP) {
- free(dir);
+ free(mp->mnt_dir);
free(fsname);
}
}