{ default_str, 3, 1024, 8192 },
{ "journal", 0, 4096, 8192 },
{ "news", 0, 4096, 4096 },
- { "largefile", 0, 4096, 1024 * 1024 },
+ { "largefile", 0, 4096, 1024 * 1024 },
{ "largefile4", 0, 4096, 4096 * 1024 },
- { 0, 0, 0, 0},
+ { 0, 0, 0, 0},
};
static void set_fs_defaults(const char *fs_type,
num = fs->inode_blocks_per_group;
retval = zero_blocks(fs, blk, num, 0, &blk, &num);
- mke2fs_error_msg_and_die(retval,
+ mke2fs_error_msg_and_die(retval,
"write %d blocks in inode table starting at %d.",
num, blk);
if (sync_kludge) {
static void create_journal_dev(ext2_filsys fs)
{
- struct progress_struct progress;
+ struct progress_struct progress;
errcode_t retval;
char *buf;
char *fmt = "%s journal superblock";
os,
fs->blocksize, s->s_log_block_size,
fs->fragsize, s->s_log_frag_size,
- s->s_inodes_count, s->s_blocks_count,
+ s->s_inodes_count, s->s_blocks_count,
s->s_r_blocks_count, 100.0 * s->s_r_blocks_count / s->s_blocks_count,
s->s_first_data_block);
free(os);
if((sb->s_creator_os = e2p_string2os(os)) >= 0) {
return 1;
} else if (!strcasecmp("GNU", os)) {
- sb->s_creator_os = EXT2_OS_HURD;
+ sb->s_creator_os = EXT2_OS_HURD;
return 1;
}
return 0;
}
-#define PATH_SET "PATH=/sbin"
-
static void parse_extended_opts(struct ext2_super_block *sb_param,
const char *opts)
{
int show_version_only = 0;
ext2_ino_t num_inodes = 0;
errcode_t retval;
- char * oldpath = getenv("PATH");
char * extended_opts = 0;
const char * fs_type = 0;
blk_t dev_size;
long sysval;
/* Update our PATH to include /sbin */
- if (oldpath) {
- putenv (bb_xasprintf("%s:%s", PATH_SET, oldpath));
- } else
- putenv (PATH_SET);
+ e2fs_set_sbin_path();
tmp = getenv("MKE2FS_SYNC");
if (tmp)
#endif
/* If called as mkfs.ext3, create a journal inode */
- if (last_char_is(bb_applet_name, '3'))
+ if (last_char_is(bb_applet_name, '3'))
journal_size = -1;
while ((c = getopt (argc, argv,
mke2fs_warning_msg(1, "fragments not supported. Ignoring -f option");
break;
case 'g':
- if (safe_strtoi(optarg, ¶m.s_blocks_per_group)) {
+ {
+ int foo;
+ if (safe_strtoi(optarg, &foo)) {
bb_error_msg_and_die("Illegal number for blocks per group");
+ }
+ param.s_blocks_per_group = foo;
}
if ((param.s_blocks_per_group % 8) != 0) {
bb_error_msg_and_die("blocks per group must be multiple of 8");
}
break;
case 'i':
- if (safe_strtoi(optarg, &inode_ratio)
- || inode_ratio < EXT2_MIN_BLOCK_SIZE
+ if (safe_strtoi(optarg, &inode_ratio)
+ || inode_ratio < EXT2_MIN_BLOCK_SIZE
|| inode_ratio > EXT2_MAX_BLOCK_SIZE * 1024) {
bb_error_msg_and_die("bad inode ratio %s (min %d/max %d)",
optarg, EXT2_MIN_BLOCK_SIZE,