$(CC) $(LDFLAGS) -o $@ $^ $(LIBRARIES)
$(STRIP)
-docs: docs/busybox.pod
- $(MAKE) -C docs clean all
-
busybox.links: busybox.def.h
- ./busybox.mkll | sort >$@
+docs:
+ $(MAKE) -C docs
+
regexp.o nfsmount.o: %.o: %.h
$(OBJECTS): %.o: busybox.def.h internal.h %.c
./install.sh $(PREFIX)
dist release: distclean
- $(MAKE) -C docs clean all
+ $(MAKE) -C docs
cd ..; \
rm -rf busybox-$(VERSION); \
cp -a busybox busybox-$(VERSION); \
{"uname", uname_main, _BB_DIR_BIN},
#endif
#ifdef BB_UNIQ
- {"uniq", uniq_main, _BB_DIR_BIN},
+ {"uniq", uniq_main, _BB_DIR_USR_BIN},
#endif
#ifdef BB_UPDATE
{"update", update_main, _BB_DIR_SBIN},
{"uname", uname_main, _BB_DIR_BIN},
#endif
#ifdef BB_UNIQ
- {"uniq", uniq_main, _BB_DIR_BIN},
+ {"uniq", uniq_main, _BB_DIR_USR_BIN},
#endif
#ifdef BB_UPDATE
{"update", update_main, _BB_DIR_SBIN},
void cmdedit_reset_term(void)
{
if (reset_term)
+ /* sparc and other have broken termios support: use old termio handling. */
ioctl(fileno(stdin), TCSETA, (void *) &old_term);
}
memset(command, 0, sizeof(command));
if (!reset_term) {
+ /* sparc and other have broken termios support: use old termio handling. */
ioctl(inputFd, TCGETA, (void *) &old_term);
memcpy(&new_term, &old_term, sizeof(struct termio));
}
nr = len + 1;
+ /* sparc and other have broken termios support: use old termio handling. */
ioctl(inputFd, TCSETA, (void *) &old_term);
reset_term = 0;
#define PSF_MAXMODE 0x03
#define PSF_SEPARATOR 0xFFFF
-static const char loadfont_usage[] = "loadfont\n"
- "\n" "\tLoad a console font from standard input.\n" "\n";
+static const char loadfont_usage[] = "loadfont\n\n"
+ "Loads a console font from standard input.\n";
struct psf_header {
unsigned char magic1, magic2; /* Magic number */
{
int fd;
+ if (argc>=2 && *argv[1]=='-') {
+ usage(loadfont_usage);
+ }
+
fd = open("/dev/tty0", O_RDWR);
if (fd < 0) {
fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno));
# ------------------------
# Copyright (C) 2000 Erik Andersen <andersee@debian.org> GPL
-all:: clean doc
+all: clean doc
doc:
@echo
pod2text busybox.pod > ../BusyBox.txt
@rm -f pod2html*
-clean::
+clean:
@rm -f ../BusyBox.html ../BusyBox.1 ../BusyBox.txt pod2html*
distclean: clean
-.PHONY: all clean distclean doc
-
-------------------------------
-=item cat
+=item cat
Usage: cat [file ...]
=item loadacm
-FIXME
+FIXME -- this command does not yet have proper documentation
-------------------------------
=item loadfont
-FIXME
+Usage: loadfont
+
+Loads a console font from standard input.
+
-------------------------------
=item loadkmap
-FIXME
+FIXME -- this command does not yet have proper documentation
-------------------------------
lash -- the BusyBox LAme SHell (command interpreter)
-FIXME
+FIXME -- this command does not yet have proper documentation
-------------------------------
=cut
-# $Id: busybox.pod,v 1.15 2000/04/17 17:46:46 beppu Exp $
+# $Id: busybox.pod,v 1.16 2000/04/18 00:00:52 erik Exp $
for(; pidList && pidList!=0; pidList++) {
if (kill(*pidList, sig) != 0)
fatalError( "Could not kill pid '%d': %s\n", *pidList, strerror(errno));
+ else
+ printf("killed %d\n", *pidList);
}
/* Note that we don't bother to free the memory
* allocated in findPidByName(). It will be freed
{"pwd", "Print current directory", "pwd", shell_pwd},
{"export", "Set environment variable", "export [VAR=value]", shell_export},
{"unset", "Unset environment variable", "unset VAR", shell_unset},
-
{".", "Source-in and run commands in a file", ". filename", shell_source},
{"help", "List shell built-in commands", "help", shell_help},
{NULL, NULL, NULL, NULL}
#define PSF_MAXMODE 0x03
#define PSF_SEPARATOR 0xFFFF
-static const char loadfont_usage[] = "loadfont\n"
- "\n" "\tLoad a console font from standard input.\n" "\n";
+static const char loadfont_usage[] = "loadfont\n\n"
+ "Loads a console font from standard input.\n";
struct psf_header {
unsigned char magic1, magic2; /* Magic number */
{
int fd;
+ if (argc>=2 && *argv[1]=='-') {
+ usage(loadfont_usage);
+ }
+
fd = open("/dev/tty0", O_RDWR);
if (fd < 0) {
fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno));
static const char more_usage[] = "more [file ...]\n";
-/* ED: sparc termios is broken: revert back to old termio handling. */
#ifdef BB_FEATURE_USE_TERMIOS
-#if #cpu(sparc)
-# define USE_OLD_TERMIO
-# include <termio.h>
-# define termios termio
-# define stty(fd,argp) ioctl(fd,TCSETAF,argp)
-#else
-# include <termios.h>
-# define stty(fd,argp) tcsetattr(fd,TCSANOW,argp)
-#endif
+#include <termio.h>
FILE *cin;
-struct termios initial_settings, new_settings;
+/* sparc and other have broken termios support: use old termio handling. */
+struct termio initial_settings, new_settings;
void gotsig(int sig)
{
- stty(fileno(cin), &initial_settings);
+ ioctl(fileno(cin), TCSETAF, &initial_settings);
fprintf(stdout, "\n");
exit(TRUE);
}
cin = fopen("/dev/tty", "r");
if (!cin)
cin = fopen("/dev/console", "r");
-#ifdef USE_OLD_TERMIO
ioctl(fileno(cin), TCGETA, &initial_settings);
-#else
- tcgetattr(fileno(cin), &initial_settings);
-#endif
new_settings = initial_settings;
new_settings.c_lflag &= ~ICANON;
new_settings.c_lflag &= ~ECHO;
- stty(fileno(cin), &new_settings);
+ ioctl(fileno(cin), TCSETAF, &new_settings);
#ifdef BB_FEATURE_AUTOWIDTH
ioctl(fileno(stdout), TIOCGWINSZ, &win);
for(; pidList && pidList!=0; pidList++) {
if (kill(*pidList, sig) != 0)
fatalError( "Could not kill pid '%d': %s\n", *pidList, strerror(errno));
+ else
+ printf("killed %d\n", *pidList);
}
/* Note that we don't bother to free the memory
* allocated in findPidByName(). It will be freed
{"pwd", "Print current directory", "pwd", shell_pwd},
{"export", "Set environment variable", "export [VAR=value]", shell_export},
{"unset", "Unset environment variable", "unset VAR", shell_unset},
-
{".", "Source-in and run commands in a file", ". filename", shell_source},
{"help", "List shell built-in commands", "help", shell_help},
{NULL, NULL, NULL, NULL}
void cmdedit_reset_term(void)
{
if (reset_term)
+ /* sparc and other have broken termios support: use old termio handling. */
ioctl(fileno(stdin), TCSETA, (void *) &old_term);
}
memset(command, 0, sizeof(command));
if (!reset_term) {
+ /* sparc and other have broken termios support: use old termio handling. */
ioctl(inputFd, TCGETA, (void *) &old_term);
memcpy(&new_term, &old_term, sizeof(struct termio));
}
nr = len + 1;
+ /* sparc and other have broken termios support: use old termio handling. */
ioctl(inputFd, TCSETA, (void *) &old_term);
reset_term = 0;
{"pwd", "Print current directory", "pwd", shell_pwd},
{"export", "Set environment variable", "export [VAR=value]", shell_export},
{"unset", "Unset environment variable", "unset VAR", shell_unset},
-
{".", "Source-in and run commands in a file", ". filename", shell_source},
{"help", "List shell built-in commands", "help", shell_help},
{NULL, NULL, NULL, NULL}
}
else {
#define BUFSIZE 1024 + 1
- char buf[BUFSIZE];
+ char buf;
char *q, *p;
int n_read;
char line[BUFSIZE];
unsigned char c;
+ int pri;
- /* Keep reading stuff till there is nothing else to read */
- while( (n_read = read (fd, buf, BUFSIZE)) > 0 && errno != EOF) {
- int pri = (LOG_USER | LOG_NOTICE);
+ /* Get set to read in a line */
+ memset (line, 0, sizeof(line));
+ pri = (LOG_USER | LOG_NOTICE);
- memset (line, 0, sizeof(line));
- p = buf;
+ /* Keep reading stuff till there is nothing else to read */
+ while( (n_read = read (fd, &buf, 1)) > 0) {
+ p = &buf;
q = line;
while (p && (c = *p) && q < &line[sizeof(line) - 1]) {
if (c == '<') {
/* Now log it */
logMessage(pri, line);
+ break;
}
close (fd);
FD_CLR (fd, &readfds);
}
else {
#define BUFSIZE 1024 + 1
- char buf[BUFSIZE];
+ char buf;
char *q, *p;
int n_read;
char line[BUFSIZE];
unsigned char c;
+ int pri;
- /* Keep reading stuff till there is nothing else to read */
- while( (n_read = read (fd, buf, BUFSIZE)) > 0 && errno != EOF) {
- int pri = (LOG_USER | LOG_NOTICE);
+ /* Get set to read in a line */
+ memset (line, 0, sizeof(line));
+ pri = (LOG_USER | LOG_NOTICE);
- memset (line, 0, sizeof(line));
- p = buf;
+ /* Keep reading stuff till there is nothing else to read */
+ while( (n_read = read (fd, &buf, 1)) > 0) {
+ p = &buf;
q = line;
while (p && (c = *p) && q < &line[sizeof(line) - 1]) {
if (c == '<') {
/* Now log it */
logMessage(pri, line);
+ break;
}
close (fd);
FD_CLR (fd, &readfds);
static const char more_usage[] = "more [file ...]\n";
-/* ED: sparc termios is broken: revert back to old termio handling. */
#ifdef BB_FEATURE_USE_TERMIOS
-#if #cpu(sparc)
-# define USE_OLD_TERMIO
-# include <termio.h>
-# define termios termio
-# define stty(fd,argp) ioctl(fd,TCSETAF,argp)
-#else
-# include <termios.h>
-# define stty(fd,argp) tcsetattr(fd,TCSANOW,argp)
-#endif
+#include <termio.h>
FILE *cin;
-struct termios initial_settings, new_settings;
+/* sparc and other have broken termios support: use old termio handling. */
+struct termio initial_settings, new_settings;
void gotsig(int sig)
{
- stty(fileno(cin), &initial_settings);
+ ioctl(fileno(cin), TCSETAF, &initial_settings);
fprintf(stdout, "\n");
exit(TRUE);
}
cin = fopen("/dev/tty", "r");
if (!cin)
cin = fopen("/dev/console", "r");
-#ifdef USE_OLD_TERMIO
ioctl(fileno(cin), TCGETA, &initial_settings);
-#else
- tcgetattr(fileno(cin), &initial_settings);
-#endif
new_settings = initial_settings;
new_settings.c_lflag &= ~ICANON;
new_settings.c_lflag &= ~ECHO;
- stty(fileno(cin), &new_settings);
+ ioctl(fileno(cin), TCSETAF, &new_settings);
#ifdef BB_FEATURE_AUTOWIDTH
ioctl(fileno(stdout), TIOCGWINSZ, &win);
pidList[i++]=strtol(next->d_name, NULL, 0);
}
}
- pidList[i]=0;
+ if (pidList!=NULL)
+ pidList[i]=0;
return pidList;
}
#endif /* BB_FEATURE_USE_DEVPS_PATCH */