aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mkfs_minix.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-12 17:55:51 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-12 17:55:51 +0000
commitdac7ff15b7d32deeeef3d9665744fc5774c21d70 (patch)
tree0e4c34863628d79fdad0c6217f4deb0ca0a91c33 /util-linux/mkfs_minix.c
parent79865bc5077cf6d17b27e9599921d4c85b1575fd (diff)
downloadbusybox-dac7ff15b7d32deeeef3d9665744fc5774c21d70.tar.gz
- patch from Denis Vlasenko to add and use bb_xsocket() and to use
bb_xopen some more while at it. Also use shorter boilerplate while at it.
Diffstat (limited to 'util-linux/mkfs_minix.c')
-rw-r--r--util-linux/mkfs_minix.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index 904a58ee3..30bc9f12d 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -307,8 +307,7 @@ static inline int get_size(const char *file)
int fd;
long size;
- if ((fd = open(file, O_RDWR)) < 0)
- bb_perror_msg_and_die("%s", file);
+ fd = bb_xopen(file, O_RDWR);
if (ioctl(fd, BLKGETSIZE, &size) >= 0) {
close(fd);
return (size * 512);
@@ -821,9 +820,7 @@ goodbye:
tmp += dirsize;
*(short *) tmp = 2;
strcpy(tmp + 2, ".badblocks");
- DEV = open(device_name, O_RDWR);
- if (DEV < 0)
- bb_error_msg_and_die("unable to open %s", device_name);
+ DEV = bb_xopen(device_name, O_RDWR);
if (fstat(DEV, &statbuf) < 0)
bb_error_msg_and_die("unable to stat %s", device_name);
if (!S_ISBLK(statbuf.st_mode))