int fd;
long size;
- if ((fd = open(file, O_RDWR)) < 0)
- bb_perror_msg_and_die("%s", file);
+ fd = bb_xopen3(file, O_RDWR, 0);
if (ioctl(fd, BLKGETSIZE, &size) >= 0) {
close(fd);
return (size * 512);
printf("one bad block\n");
}
-extern int mkfs_minix_main(int argc, char **argv)
+int mkfs_minix_main(int argc, char **argv)
{
int i=1;
char *tmp;
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_xopen3(device_name, O_RDWR, 0);
if (fstat(DEV, &statbuf) < 0)
bb_error_msg_and_die("unable to stat %s", device_name);
if (!S_ISBLK(statbuf.st_mode))