remove bug: fsck do not know path

This commit is contained in:
"Vladimir N. Oleynik" 2005-11-26 11:01:23 +00:00
parent cc34344d91
commit 350865e339
4 changed files with 10 additions and 10 deletions

View File

@ -1361,7 +1361,7 @@ int fsck_main(int argc, char *argv[])
fstab = _PATH_MNTTAB;
load_fs_info(fstab);
e2fs_set_sbin_path();
fsck_path = e2fs_set_sbin_path();
if ((num_devices == 1) || (serialize))
interactive = 1;
@ -1405,8 +1405,6 @@ int fsck_main(int argc, char *argv[])
}
}
status |= wait_many(FLAG_WAIT_ALL);
if (ENABLE_FEATURE_CLEAN_UP)
free(fsck_path);
blkid_put_cache(cache);
return status;
}

View File

@ -13,4 +13,4 @@
#define FSCK_CANCELED 32 /* Aborted with a signal or ^C */
#define EXIT_LIBRARY 128
extern void e2fs_set_sbin_path(void);
extern char *e2fs_set_sbin_path(void);

View File

@ -254,13 +254,15 @@ void make_journal_blocks(ext2_filsys fs, int journal_size, int journal_flags, in
puts("done");
}
void e2fs_set_sbin_path(void)
char *e2fs_set_sbin_path(void)
{
char *oldpath = getenv("PATH");
/* Update our PATH to include /sbin */
#define PATH_SET "/sbin"
if (oldpath)
putenv (bb_xasprintf("%s:%s", PATH_SET, oldpath));
else
putenv (PATH_SET);
if (oldpath)
oldpath = bb_xasprintf("%s:%s", PATH_SET, oldpath);
else
oldpath = PATH_SET;
putenv (oldpath);
return oldpath;
}

View File

@ -18,4 +18,4 @@ extern int figure_journal_size(int size, 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_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);