+/* vi: set sw=4 ts=4: */
/*
* mke2fs.c - Make a ext2fs filesystem.
*
if (retval) {
va_start(ap, fmt);
- bb_fprintf(stderr,"\nCould not ");
- bb_vfprintf(stderr, fmt, ap);
- bb_fprintf(stderr, "\n");
+ fprintf(stderr,"\nCould not ");
+ vfprintf(stderr, fmt, ap);
+ fprintf(stderr, "\n");
va_end(ap);
exit(EXIT_FAILURE);
}
if (!quiet) {
va_start(ap, fmt);
- bb_vfprintf(stdout, fmt, ap);
+ vfprintf(stdout, fmt, ap);
fflush(stdout);
va_end(ap);
}
if (retval) {
va_start(ap, fmt);
- bb_fprintf(stderr,"\nWarning: ");
- bb_vfprintf(stderr, fmt, ap);
- bb_fprintf(stderr, "\n");
+ fprintf(stderr,"\nWarning: ");
+ vfprintf(stderr, fmt, ap);
+ fprintf(stderr, "\n");
va_end(ap);
}
}
FILE *f;
errcode_t retval;
- f = bb_xfopen(bad_blocks_file, "r");
+ f = xfopen(bad_blocks_file, "r");
retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
fclose (f);
mke2fs_error_msg_and_die(retval, "read bad blocks from list");
mke2fs_verbose("Running command: %s\n", buf);
f = popen(buf, "r");
if (!f) {
- bb_perror_msg_and_die("Could not run '%s'", buf);
+ bb_perror_msg_and_die("cannot run '%s'", buf);
}
retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
pclose(f);
}
/* Allocate the zeroizing buffer if necessary */
if (!buf) {
- buf = xcalloc(fs->blocksize, STRIDE_LENGTH);
+ buf = xzalloc(fs->blocksize * STRIDE_LENGTH);
}
/* OK, do the write loop */
next_update = 0;
char *buf, *token, *next, *p, *arg;
int r_usage = 0;
- buf = bb_xstrdup(opts);
+ buf = xstrdup(opts);
for (token = buf; token && *token; token = next) {
p = strchr(token, ',');
next = 0;
}
if (resize <= sb_param->s_blocks_count) {
bb_error_msg("The resize maximum must be greater "
- "than the filesystem size");
+ "than the filesystem size");
r_usage++;
continue;
}
param.s_rev_level = 1; /* Create revision 1 filesystems now */
param.s_feature_incompat |= EXT2_FEATURE_INCOMPAT_FILETYPE;
param.s_feature_ro_compat |= EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER;
-#if 0
- param.s_feature_compat |= EXT2_FEATURE_COMPAT_DIR_INDEX;
-#endif
#ifdef __linux__
linux_version_code = get_linux_version_code();
#endif
/* If called as mkfs.ext3, create a journal inode */
- if (last_char_is(bb_applet_name, '3'))
+ if (last_char_is(applet_name, '3'))
journal_size = -1;
while ((c = getopt (argc, argv,
retval = zero_blocks(fs, start, blocks - start,
NULL, &ret_blk, NULL);
- mke2fs_warning_msg(retval, "could not zero block %u at end of filesystem", ret_blk);
+ mke2fs_warning_msg(retval, "cannot zero block %u at end of filesystem", ret_blk);
write_inode_tables(fs);
create_root_dir(fs);
create_lost_and_found(fs);