remove bug: fsck do not know path
This commit is contained in:
parent
cc34344d91
commit
350865e339
@ -1361,7 +1361,7 @@ int fsck_main(int argc, char *argv[])
|
|||||||
fstab = _PATH_MNTTAB;
|
fstab = _PATH_MNTTAB;
|
||||||
load_fs_info(fstab);
|
load_fs_info(fstab);
|
||||||
|
|
||||||
e2fs_set_sbin_path();
|
fsck_path = e2fs_set_sbin_path();
|
||||||
|
|
||||||
if ((num_devices == 1) || (serialize))
|
if ((num_devices == 1) || (serialize))
|
||||||
interactive = 1;
|
interactive = 1;
|
||||||
@ -1405,8 +1405,6 @@ int fsck_main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
status |= wait_many(FLAG_WAIT_ALL);
|
status |= wait_many(FLAG_WAIT_ALL);
|
||||||
if (ENABLE_FEATURE_CLEAN_UP)
|
|
||||||
free(fsck_path);
|
|
||||||
blkid_put_cache(cache);
|
blkid_put_cache(cache);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -13,4 +13,4 @@
|
|||||||
#define FSCK_CANCELED 32 /* Aborted with a signal or ^C */
|
#define FSCK_CANCELED 32 /* Aborted with a signal or ^C */
|
||||||
#define EXIT_LIBRARY 128
|
#define EXIT_LIBRARY 128
|
||||||
|
|
||||||
extern void e2fs_set_sbin_path(void);
|
extern char *e2fs_set_sbin_path(void);
|
||||||
|
@ -254,13 +254,15 @@ void make_journal_blocks(ext2_filsys fs, int journal_size, int journal_flags, in
|
|||||||
puts("done");
|
puts("done");
|
||||||
}
|
}
|
||||||
|
|
||||||
void e2fs_set_sbin_path(void)
|
char *e2fs_set_sbin_path(void)
|
||||||
{
|
{
|
||||||
char *oldpath = getenv("PATH");
|
char *oldpath = getenv("PATH");
|
||||||
/* Update our PATH to include /sbin */
|
/* Update our PATH to include /sbin */
|
||||||
#define PATH_SET "/sbin"
|
#define PATH_SET "/sbin"
|
||||||
if (oldpath)
|
if (oldpath)
|
||||||
putenv (bb_xasprintf("%s:%s", PATH_SET, oldpath));
|
oldpath = bb_xasprintf("%s:%s", PATH_SET, oldpath);
|
||||||
else
|
else
|
||||||
putenv (PATH_SET);
|
oldpath = PATH_SET;
|
||||||
|
putenv (oldpath);
|
||||||
|
return oldpath;
|
||||||
}
|
}
|
||||||
|
@ -18,4 +18,4 @@ extern int figure_journal_size(int size, ext2_filsys fs);
|
|||||||
extern void print_check_message(ext2_filsys fs);
|
extern void print_check_message(ext2_filsys fs);
|
||||||
extern void make_journal_device(char *journal_device, ext2_filsys fs, int quiet, int force);
|
extern void make_journal_device(char *journal_device, ext2_filsys fs, int quiet, int force);
|
||||||
extern void make_journal_blocks(ext2_filsys fs, int journal_size, int journal_flags, int quiet);
|
extern void make_journal_blocks(ext2_filsys fs, int journal_size, int journal_flags, int quiet);
|
||||||
extern void e2fs_set_sbin_path(void);
|
extern char *e2fs_set_sbin_path(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user