summaryrefslogtreecommitdiff
path: root/util-linux/mkfs_minix.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /util-linux/mkfs_minix.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
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))