← Commit list

09bbb2892

Denys Vlasenko
Denys Vlasenko
2009-10-22
FAILED Duration: 32s

Subject

mkfs_ext2: fix a bug where we don't fully respect -n on files

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/mkfs_ext2.c+2 -1
@@ -233,7 +233,8 @@ int mkfs_ext2_main(int argc UNUSED_PARAM, char **argv)
kilobytes = xatoull(argv[1]);
// seek past end fails on block devices but works on files
if (lseek(fd, kilobytes * 1024 - 1, SEEK_SET) != (off_t)-1) {
- xwrite(fd, "", 1); // file grows if needed
+ if (!(opts & OPT_n))
+ xwrite(fd, "", 1); // file grows if needed
}
//else {
// bb_error_msg("warning, block device is smaller");