aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mkfs_minix.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/mkfs_minix.c')
-rw-r--r--util-linux/mkfs_minix.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index 7f52b563e..a8737a6c9 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -62,20 +62,8 @@
62 * removed getopt based parser and added a hand rolled one. 62 * removed getopt based parser and added a hand rolled one.
63 */ 63 */
64 64
65#include <stdio.h>
66#include <time.h>
67#include <unistd.h>
68#include <string.h>
69#include <signal.h>
70#include <fcntl.h>
71#include <ctype.h>
72#include <stdlib.h>
73#include <stdint.h>
74#include <termios.h>
75#include <sys/ioctl.h>
76#include <sys/param.h>
77#include <mntent.h>
78#include "busybox.h" 65#include "busybox.h"
66#include <mntent.h>
79 67
80#define MINIX_ROOT_INO 1 68#define MINIX_ROOT_INO 1
81#define MINIX_LINK_MAX 250 69#define MINIX_LINK_MAX 250
@@ -304,7 +292,7 @@ static inline int get_size(const char *file)
304 int fd; 292 int fd;
305 long size; 293 long size;
306 294
307 fd = bb_xopen3(file, O_RDWR, 0); 295 fd = xopen3(file, O_RDWR, 0);
308 if (ioctl(fd, BLKGETSIZE, &size) >= 0) { 296 if (ioctl(fd, BLKGETSIZE, &size) >= 0) {
309 close(fd); 297 close(fd);
310 return (size * 512); 298 return (size * 512);
@@ -678,7 +666,7 @@ static void get_list_blocks(char *filename)
678 FILE *listfile; 666 FILE *listfile;
679 unsigned long blockno; 667 unsigned long blockno;
680 668
681 listfile = bb_xfopen(filename, "r"); 669 listfile = xfopen(filename, "r");
682 while (!feof(listfile)) { 670 while (!feof(listfile)) {
683 fscanf(listfile, "%ld\n", &blockno); 671 fscanf(listfile, "%ld\n", &blockno);
684 mark_zone(blockno); 672 mark_zone(blockno);
@@ -817,7 +805,7 @@ goodbye:
817 tmp += dirsize; 805 tmp += dirsize;
818 *(short *) tmp = 2; 806 *(short *) tmp = 2;
819 strcpy(tmp + 2, ".badblocks"); 807 strcpy(tmp + 2, ".badblocks");
820 DEV = bb_xopen3(device_name, O_RDWR, 0); 808 DEV = xopen3(device_name, O_RDWR, 0);
821 if (fstat(DEV, &statbuf) < 0) 809 if (fstat(DEV, &statbuf) < 0)
822 bb_error_msg_and_die("unable to stat %s", device_name); 810 bb_error_msg_and_die("unable to stat %s", device_name);
823 if (!S_ISBLK(statbuf.st_mode)) 811 if (!S_ISBLK(statbuf.st_mode))