summaryrefslogtreecommitdiff
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-w32-dac7ff15b7d32deeeef3d9665744fc5774c21d70.tar.gz
busybox-w32-dac7ff15b7d32deeeef3d9665744fc5774c21d70.tar.bz2
busybox-w32-dac7ff15b7d32deeeef3d9665744fc5774c21d70.zip
- 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)
307 int fd; 307 int fd;
308 long size; 308 long size;
309 309
310 if ((fd = open(file, O_RDWR)) < 0) 310 fd = bb_xopen(file, O_RDWR);
311 bb_perror_msg_and_die("%s", file);
312 if (ioctl(fd, BLKGETSIZE, &size) >= 0) { 311 if (ioctl(fd, BLKGETSIZE, &size) >= 0) {
313 close(fd); 312 close(fd);
314 return (size * 512); 313 return (size * 512);
@@ -821,9 +820,7 @@ goodbye:
821 tmp += dirsize; 820 tmp += dirsize;
822 *(short *) tmp = 2; 821 *(short *) tmp = 2;
823 strcpy(tmp + 2, ".badblocks"); 822 strcpy(tmp + 2, ".badblocks");
824 DEV = open(device_name, O_RDWR); 823 DEV = bb_xopen(device_name, O_RDWR);
825 if (DEV < 0)
826 bb_error_msg_and_die("unable to open %s", device_name);
827 if (fstat(DEV, &statbuf) < 0) 824 if (fstat(DEV, &statbuf) < 0)
828 bb_error_msg_and_die("unable to stat %s", device_name); 825 bb_error_msg_and_die("unable to stat %s", device_name);
829 if (!S_ISBLK(statbuf.st_mode)) 826 if (!S_ISBLK(statbuf.st_mode))