Latest and greatest. Some effort at libc5 (aiming towards newlib)
compatability. -Erik
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/mount.h>
|
||||
#include <linux/fs.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "internal.h"
|
||||
|
||||
|
||||
|
||||
static const char freeramdisk_usage[] =
|
||||
"freeramdisk DEVICE\n\n"
|
||||
"Free all memory used by the specified ramdisk.\n";
|
||||
|
@@ -97,7 +97,6 @@
|
||||
#include <termios.h>
|
||||
#include <mntent.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h> /* for PATH_MAX */
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/minix_fs.h>
|
||||
@@ -145,7 +144,7 @@ static int termios_set = 0;
|
||||
/* File-name data */
|
||||
#define MAX_DEPTH 32
|
||||
static int name_depth = 0;
|
||||
// static char name_list[MAX_DEPTH][PATH_MAX + 1];
|
||||
// static char name_list[MAX_DEPTH][BUFSIZ + 1];
|
||||
static char **name_list = NULL;
|
||||
|
||||
static char *inode_buffer = NULL;
|
||||
@@ -178,8 +177,8 @@ static unsigned char *zone_count = NULL;
|
||||
static void recursive_check(unsigned int ino);
|
||||
static void recursive_check2(unsigned int ino);
|
||||
|
||||
#define inode_in_use(x) (bit(inode_map,(x)))
|
||||
#define zone_in_use(x) (bit(zone_map,(x)-FIRSTZONE+1))
|
||||
#define inode_in_use(x) (isset(inode_map,(x)))
|
||||
#define zone_in_use(x) (isset(zone_map,(x)-FIRSTZONE+1))
|
||||
|
||||
#define mark_inode(x) (setbit(inode_map,(x)),changed=1)
|
||||
#define unmark_inode(x) (clrbit(inode_map,(x)),changed=1)
|
||||
@@ -1239,7 +1238,7 @@ static void alloc_name_list(void)
|
||||
|
||||
name_list = xmalloc(sizeof(char *) * MAX_DEPTH);
|
||||
for (i = 0; i < MAX_DEPTH; i++)
|
||||
name_list[i] = xmalloc(sizeof(char) * PATH_MAX + 1);
|
||||
name_list[i] = xmalloc(sizeof(char) * BUFSIZ + 1);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@@ -154,8 +154,8 @@ static unsigned short good_blocks_table[MAX_GOOD_BLOCKS];
|
||||
static int used_good_blocks = 0;
|
||||
static unsigned long req_nr_inodes = 0;
|
||||
|
||||
#define inode_in_use(x) (bit(inode_map,(x)))
|
||||
#define zone_in_use(x) (bit(zone_map,(x)-FIRSTZONE+1))
|
||||
#define inode_in_use(x) (isset(inode_map,(x)))
|
||||
#define zone_in_use(x) (isset(zone_map,(x)-FIRSTZONE+1))
|
||||
|
||||
#define mark_inode(x) (setbit(inode_map,(x)))
|
||||
#define unmark_inode(x) (clrbit(inode_map,(x)))
|
||||
|
@@ -48,6 +48,7 @@ static const char more_usage[] = "more [file ...]\n";
|
||||
#endif
|
||||
|
||||
FILE *cin;
|
||||
|
||||
struct termios initial_settings, new_settings;
|
||||
|
||||
void gotsig(int sig)
|
||||
@@ -65,7 +66,10 @@ void gotsig(int sig)
|
||||
|
||||
|
||||
#if defined BB_FEATURE_AUTOWIDTH
|
||||
static int terminal_width = 0, terminal_height = 0;
|
||||
#ifdef BB_FEATURE_USE_TERMIOS
|
||||
static int terminal_width = 0;
|
||||
#endif
|
||||
static int terminal_height = 0;
|
||||
#else
|
||||
#define terminal_width TERMINAL_WIDTH
|
||||
#define terminal_height TERMINAL_HEIGHT
|
||||
@@ -80,7 +84,7 @@ extern int more_main(int argc, char **argv)
|
||||
struct stat st;
|
||||
FILE *file;
|
||||
|
||||
#ifdef BB_FEATURE_AUTOWIDTH
|
||||
#if defined BB_FEATURE_AUTOWIDTH && defined BB_FEATURE_USE_TERMIOS
|
||||
struct winsize win = { 0, 0 };
|
||||
#endif
|
||||
|
||||
@@ -151,7 +155,11 @@ extern int more_main(int argc, char **argv)
|
||||
);
|
||||
|
||||
fflush(stdout);
|
||||
#ifdef BB_FEATURE_USE_TERMIOS
|
||||
input = getc(cin);
|
||||
#else
|
||||
input = getc(stdin);
|
||||
#endif
|
||||
|
||||
#ifdef BB_FEATURE_USE_TERMIOS
|
||||
/* Erase the "More" message */
|
||||
|
@@ -48,6 +48,9 @@
|
||||
#if defined BB_FEATURE_USE_DEVPS_PATCH
|
||||
#include <linux/devmtab.h>
|
||||
#endif
|
||||
#ifndef MS_RDONLY
|
||||
#include <linux/fs.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if defined BB_FEATURE_MOUNT_LOOP
|
||||
|
Reference in New Issue
Block a user