diff options
| author | Erik Andersen <andersen@codepoet.org> | 2000-04-28 00:18:56 +0000 |
|---|---|---|
| committer | Erik Andersen <andersen@codepoet.org> | 2000-04-28 00:18:56 +0000 |
| commit | 4f3f757d56fbf420ea5030dcf7ea971b3da3ab47 (patch) | |
| tree | d986e9bb9f03bf1f83465c274c35c0d58ed544e4 /util-linux | |
| parent | 227a59b05d6df9b4be5990915646249d6f548822 (diff) | |
| download | busybox-w32-4f3f757d56fbf420ea5030dcf7ea971b3da3ab47.tar.gz busybox-w32-4f3f757d56fbf420ea5030dcf7ea971b3da3ab47.tar.bz2 busybox-w32-4f3f757d56fbf420ea5030dcf7ea971b3da3ab47.zip | |
Latest and greatest. Some effort at libc5 (aiming towards newlib)
compatability.
-Erik
Diffstat (limited to 'util-linux')
| -rw-r--r-- | util-linux/freeramdisk.c | 3 | ||||
| -rw-r--r-- | util-linux/fsck_minix.c | 9 | ||||
| -rw-r--r-- | util-linux/mkfs_minix.c | 4 | ||||
| -rw-r--r-- | util-linux/more.c | 12 | ||||
| -rw-r--r-- | util-linux/mount.c | 3 |
5 files changed, 21 insertions, 10 deletions
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c index 9636dbdcf..d373bcbf7 100644 --- a/util-linux/freeramdisk.c +++ b/util-linux/freeramdisk.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | #include <stdio.h> | 24 | #include <stdio.h> |
| 25 | #include <string.h> | 25 | #include <string.h> |
| 26 | #include <sys/mount.h> | 26 | #include <linux/fs.h> |
| 27 | #include <sys/types.h> | 27 | #include <sys/types.h> |
| 28 | #include <sys/stat.h> | 28 | #include <sys/stat.h> |
| 29 | #include <fcntl.h> | 29 | #include <fcntl.h> |
| @@ -32,6 +32,7 @@ | |||
| 32 | #include "internal.h" | 32 | #include "internal.h" |
| 33 | 33 | ||
| 34 | 34 | ||
| 35 | |||
| 35 | static const char freeramdisk_usage[] = | 36 | static const char freeramdisk_usage[] = |
| 36 | "freeramdisk DEVICE\n\n" | 37 | "freeramdisk DEVICE\n\n" |
| 37 | "Free all memory used by the specified ramdisk.\n"; | 38 | "Free all memory used by the specified ramdisk.\n"; |
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index aa0a82432..c890dff7d 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
| @@ -97,7 +97,6 @@ | |||
| 97 | #include <termios.h> | 97 | #include <termios.h> |
| 98 | #include <mntent.h> | 98 | #include <mntent.h> |
| 99 | #include <sys/stat.h> | 99 | #include <sys/stat.h> |
| 100 | #include <sys/param.h> /* for PATH_MAX */ | ||
| 101 | 100 | ||
| 102 | #include <linux/fs.h> | 101 | #include <linux/fs.h> |
| 103 | #include <linux/minix_fs.h> | 102 | #include <linux/minix_fs.h> |
| @@ -145,7 +144,7 @@ static int termios_set = 0; | |||
| 145 | /* File-name data */ | 144 | /* File-name data */ |
| 146 | #define MAX_DEPTH 32 | 145 | #define MAX_DEPTH 32 |
| 147 | static int name_depth = 0; | 146 | static int name_depth = 0; |
| 148 | // static char name_list[MAX_DEPTH][PATH_MAX + 1]; | 147 | // static char name_list[MAX_DEPTH][BUFSIZ + 1]; |
| 149 | static char **name_list = NULL; | 148 | static char **name_list = NULL; |
| 150 | 149 | ||
| 151 | static char *inode_buffer = NULL; | 150 | static char *inode_buffer = NULL; |
| @@ -178,8 +177,8 @@ static unsigned char *zone_count = NULL; | |||
| 178 | static void recursive_check(unsigned int ino); | 177 | static void recursive_check(unsigned int ino); |
| 179 | static void recursive_check2(unsigned int ino); | 178 | static void recursive_check2(unsigned int ino); |
| 180 | 179 | ||
| 181 | #define inode_in_use(x) (bit(inode_map,(x))) | 180 | #define inode_in_use(x) (isset(inode_map,(x))) |
| 182 | #define zone_in_use(x) (bit(zone_map,(x)-FIRSTZONE+1)) | 181 | #define zone_in_use(x) (isset(zone_map,(x)-FIRSTZONE+1)) |
| 183 | 182 | ||
| 184 | #define mark_inode(x) (setbit(inode_map,(x)),changed=1) | 183 | #define mark_inode(x) (setbit(inode_map,(x)),changed=1) |
| 185 | #define unmark_inode(x) (clrbit(inode_map,(x)),changed=1) | 184 | #define unmark_inode(x) (clrbit(inode_map,(x)),changed=1) |
| @@ -1239,7 +1238,7 @@ static void alloc_name_list(void) | |||
| 1239 | 1238 | ||
| 1240 | name_list = xmalloc(sizeof(char *) * MAX_DEPTH); | 1239 | name_list = xmalloc(sizeof(char *) * MAX_DEPTH); |
| 1241 | for (i = 0; i < MAX_DEPTH; i++) | 1240 | for (i = 0; i < MAX_DEPTH; i++) |
| 1242 | name_list[i] = xmalloc(sizeof(char) * PATH_MAX + 1); | 1241 | name_list[i] = xmalloc(sizeof(char) * BUFSIZ + 1); |
| 1243 | } | 1242 | } |
| 1244 | 1243 | ||
| 1245 | #if 0 | 1244 | #if 0 |
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 1ee3d4cfa..be180a46b 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
| @@ -154,8 +154,8 @@ static unsigned short good_blocks_table[MAX_GOOD_BLOCKS]; | |||
| 154 | static int used_good_blocks = 0; | 154 | static int used_good_blocks = 0; |
| 155 | static unsigned long req_nr_inodes = 0; | 155 | static unsigned long req_nr_inodes = 0; |
| 156 | 156 | ||
| 157 | #define inode_in_use(x) (bit(inode_map,(x))) | 157 | #define inode_in_use(x) (isset(inode_map,(x))) |
| 158 | #define zone_in_use(x) (bit(zone_map,(x)-FIRSTZONE+1)) | 158 | #define zone_in_use(x) (isset(zone_map,(x)-FIRSTZONE+1)) |
| 159 | 159 | ||
| 160 | #define mark_inode(x) (setbit(inode_map,(x))) | 160 | #define mark_inode(x) (setbit(inode_map,(x))) |
| 161 | #define unmark_inode(x) (clrbit(inode_map,(x))) | 161 | #define unmark_inode(x) (clrbit(inode_map,(x))) |
diff --git a/util-linux/more.c b/util-linux/more.c index 909ed286b..30d2757cd 100644 --- a/util-linux/more.c +++ b/util-linux/more.c | |||
| @@ -48,6 +48,7 @@ static const char more_usage[] = "more [file ...]\n"; | |||
| 48 | #endif | 48 | #endif |
| 49 | 49 | ||
| 50 | FILE *cin; | 50 | FILE *cin; |
| 51 | |||
| 51 | struct termios initial_settings, new_settings; | 52 | struct termios initial_settings, new_settings; |
| 52 | 53 | ||
| 53 | void gotsig(int sig) | 54 | void gotsig(int sig) |
| @@ -65,7 +66,10 @@ void gotsig(int sig) | |||
| 65 | 66 | ||
| 66 | 67 | ||
| 67 | #if defined BB_FEATURE_AUTOWIDTH | 68 | #if defined BB_FEATURE_AUTOWIDTH |
| 68 | static int terminal_width = 0, terminal_height = 0; | 69 | #ifdef BB_FEATURE_USE_TERMIOS |
| 70 | static int terminal_width = 0; | ||
| 71 | #endif | ||
| 72 | static int terminal_height = 0; | ||
| 69 | #else | 73 | #else |
| 70 | #define terminal_width TERMINAL_WIDTH | 74 | #define terminal_width TERMINAL_WIDTH |
| 71 | #define terminal_height TERMINAL_HEIGHT | 75 | #define terminal_height TERMINAL_HEIGHT |
| @@ -80,7 +84,7 @@ extern int more_main(int argc, char **argv) | |||
| 80 | struct stat st; | 84 | struct stat st; |
| 81 | FILE *file; | 85 | FILE *file; |
| 82 | 86 | ||
| 83 | #ifdef BB_FEATURE_AUTOWIDTH | 87 | #if defined BB_FEATURE_AUTOWIDTH && defined BB_FEATURE_USE_TERMIOS |
| 84 | struct winsize win = { 0, 0 }; | 88 | struct winsize win = { 0, 0 }; |
| 85 | #endif | 89 | #endif |
| 86 | 90 | ||
| @@ -151,7 +155,11 @@ extern int more_main(int argc, char **argv) | |||
| 151 | ); | 155 | ); |
| 152 | 156 | ||
| 153 | fflush(stdout); | 157 | fflush(stdout); |
| 158 | #ifdef BB_FEATURE_USE_TERMIOS | ||
| 154 | input = getc(cin); | 159 | input = getc(cin); |
| 160 | #else | ||
| 161 | input = getc(stdin); | ||
| 162 | #endif | ||
| 155 | 163 | ||
| 156 | #ifdef BB_FEATURE_USE_TERMIOS | 164 | #ifdef BB_FEATURE_USE_TERMIOS |
| 157 | /* Erase the "More" message */ | 165 | /* Erase the "More" message */ |
diff --git a/util-linux/mount.c b/util-linux/mount.c index 972e5066c..456e45235 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
| @@ -48,6 +48,9 @@ | |||
| 48 | #if defined BB_FEATURE_USE_DEVPS_PATCH | 48 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
| 49 | #include <linux/devmtab.h> | 49 | #include <linux/devmtab.h> |
| 50 | #endif | 50 | #endif |
| 51 | #ifndef MS_RDONLY | ||
| 52 | #include <linux/fs.h> | ||
| 53 | #endif | ||
| 51 | 54 | ||
| 52 | 55 | ||
| 53 | #if defined BB_FEATURE_MOUNT_LOOP | 56 | #if defined BB_FEATURE_MOUNT_LOOP |
