diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-01 23:48:27 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-01 23:48:27 +0100 |
commit | 40e7d25aca1abbe080e00e2bed64b444a5ec7858 (patch) | |
tree | 05cda08f66542aeb94d1ebb906a0f04b04a41d62 /util-linux/mkfs_ext2.c | |
parent | 4875e7148b0512ee3c255526a484503da984935a (diff) | |
download | busybox-w32-40e7d25aca1abbe080e00e2bed64b444a5ec7858.tar.gz busybox-w32-40e7d25aca1abbe080e00e2bed64b444a5ec7858.tar.bz2 busybox-w32-40e7d25aca1abbe080e00e2bed64b444a5ec7858.zip |
mkXXXX: unify [KBYTES] parameter handling (added it to mkswap)
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 | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c index 19c3c673e..44fb40250 100644 --- a/util-linux/mkfs_ext2.c +++ b/util-linux/mkfs_ext2.c | |||
@@ -230,19 +230,7 @@ int mkfs_ext2_main(int argc UNUSED_PARAM, char **argv) | |||
230 | bb_error_msg_and_die("can't format mounted filesystem"); | 230 | bb_error_msg_and_die("can't format mounted filesystem"); |
231 | 231 | ||
232 | // open the device, get size in kbytes | 232 | // open the device, get size in kbytes |
233 | if (argv[1]) { | 233 | kilobytes = get_volume_size_in_bytes(fd, argv[1], 1024, /*extend:*/ !(option_mask32 & OPT_n)) / 1024; |
234 | kilobytes = xatoull(argv[1]); | ||
235 | // seek past end fails on block devices but works on files | ||
236 | if (lseek(fd, kilobytes * 1024 - 1, SEEK_SET) != (off_t)-1) { | ||
237 | if (!(option_mask32 & OPT_n)) | ||
238 | xwrite(fd, "", 1); // file grows if needed | ||
239 | } | ||
240 | //else { | ||
241 | // bb_error_msg("warning, block device is smaller"); | ||
242 | //} | ||
243 | } else { | ||
244 | kilobytes = (uoff_t)xlseek(fd, 0, SEEK_END) / 1024; | ||
245 | } | ||
246 | 234 | ||
247 | bytes_per_inode = 16384; | 235 | bytes_per_inode = 16384; |
248 | if (kilobytes < 512*1024) | 236 | if (kilobytes < 512*1024) |