diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-22 12:27:10 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-22 12:27:10 +0200 |
commit | 09bbb2892da80efac4451e46683f9361d59cefd5 (patch) | |
tree | 49868535e07d97521292744f3511bd2936bdebd5 /util-linux/mkfs_ext2.c | |
parent | c1ab01b61b5e37bbf8f412f6b0c451f1e6382c74 (diff) | |
download | busybox-w32-09bbb2892da80efac4451e46683f9361d59cefd5.tar.gz busybox-w32-09bbb2892da80efac4451e46683f9361d59cefd5.tar.bz2 busybox-w32-09bbb2892da80efac4451e46683f9361d59cefd5.zip |
mkfs_ext2: fix a bug where we don't fully respect -n on files
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/mkfs_ext2.c')
-rw-r--r-- | util-linux/mkfs_ext2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c index 10f7f5fb4..ea35e5287 100644 --- a/util-linux/mkfs_ext2.c +++ b/util-linux/mkfs_ext2.c | |||
@@ -233,7 +233,8 @@ int mkfs_ext2_main(int argc UNUSED_PARAM, char **argv) | |||
233 | kilobytes = xatoull(argv[1]); | 233 | kilobytes = xatoull(argv[1]); |
234 | // seek past end fails on block devices but works on files | 234 | // seek past end fails on block devices but works on files |
235 | if (lseek(fd, kilobytes * 1024 - 1, SEEK_SET) != (off_t)-1) { | 235 | if (lseek(fd, kilobytes * 1024 - 1, SEEK_SET) != (off_t)-1) { |
236 | xwrite(fd, "", 1); // file grows if needed | 236 | if (!(opts & OPT_n)) |
237 | xwrite(fd, "", 1); // file grows if needed | ||
237 | } | 238 | } |
238 | //else { | 239 | //else { |
239 | // bb_error_msg("warning, block device is smaller"); | 240 | // bb_error_msg("warning, block device is smaller"); |