aboutsummaryrefslogtreecommitdiff
path: root/mkfs_minix.c
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-03-21 22:32:57 +0000
committerErik Andersen <andersen@codepoet.org>2000-03-21 22:32:57 +0000
commit0d068a20676144e9fd6796cc77764c420d785394 (patch)
treeaf12b114d51e9ae7a8753baf09feb9ab8d654f26 /mkfs_minix.c
parentc053e41fa0524d828bf90f47e5e3637b8facaadc (diff)
downloadbusybox-0d068a20676144e9fd6796cc77764c420d785394.tar.gz
* all mallocs now use xmalloc (and so are OOM error safe), and
the common error handling saves a few bytes. Thanks to Bob Tinsley <bob@earthrise.demon.co.uk> for the patch. -Erik
Diffstat (limited to 'mkfs_minix.c')
-rw-r--r--mkfs_minix.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/mkfs_minix.c b/mkfs_minix.c
index 4435cb64a..1ee3d4cfa 100644
--- a/mkfs_minix.c
+++ b/mkfs_minix.c
@@ -530,19 +530,15 @@ static void setup_tables(void)
die("unable to allocate buffers for maps");
}
FIRSTZONE = NORM_FIRSTZONE;
- inode_map = malloc(IMAPS * BLOCK_SIZE);
- zone_map = malloc(ZMAPS * BLOCK_SIZE);
- if (!inode_map || !zone_map)
- die("unable to allocate buffers for maps");
+ inode_map = xmalloc(IMAPS * BLOCK_SIZE);
+ zone_map = xmalloc(ZMAPS * BLOCK_SIZE);
memset(inode_map, 0xff, IMAPS * BLOCK_SIZE);
memset(zone_map, 0xff, ZMAPS * BLOCK_SIZE);
for (i = FIRSTZONE; i < ZONES; i++)
unmark_zone(i);
for (i = MINIX_ROOT_INO; i <= INODES; i++)
unmark_inode(i);
- inode_buffer = malloc(INODE_BUFFER_SIZE);
- if (!inode_buffer)
- die("unable to allocate buffer for inodes");
+ inode_buffer = xmalloc(INODE_BUFFER_SIZE);
memset(inode_buffer, 0, INODE_BUFFER_SIZE);
printf("%ld inodes\n", INODES);
printf("%ld blocks\n", ZONES);