diff options
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | applets/busybox.c | 2 | ||||
-rw-r--r-- | busybox.c | 2 | ||||
-rw-r--r-- | cmdedit.c | 3 | ||||
-rw-r--r-- | console-tools/loadfont.c | 8 | ||||
-rw-r--r-- | docs/Makefile | 6 | ||||
-rw-r--r-- | docs/busybox.pod | 15 | ||||
-rw-r--r-- | kill.c | 2 | ||||
-rw-r--r-- | lash.c | 1 | ||||
-rw-r--r-- | loadfont.c | 8 | ||||
-rw-r--r-- | more.c | 22 | ||||
-rw-r--r-- | procps/kill.c | 2 | ||||
-rw-r--r-- | sh.c | 1 | ||||
-rw-r--r-- | shell/cmdedit.c | 3 | ||||
-rw-r--r-- | shell/lash.c | 1 | ||||
-rw-r--r-- | sysklogd/syslogd.c | 15 | ||||
-rw-r--r-- | syslogd.c | 15 | ||||
-rw-r--r-- | util-linux/more.c | 22 | ||||
-rw-r--r-- | utility.c | 3 |
19 files changed, 69 insertions, 70 deletions
@@ -101,12 +101,12 @@ busybox: $(OBJECTS) $(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 @@ -126,7 +126,7 @@ install: busybox busybox.links ./install.sh $(PREFIX) dist release: distclean - $(MAKE) -C docs clean all + $(MAKE) -C docs cd ..; \ rm -rf busybox-$(VERSION); \ cp -a busybox busybox-$(VERSION); \ diff --git a/applets/busybox.c b/applets/busybox.c index 15d53eb..73939c5 100644 --- a/applets/busybox.c +++ b/applets/busybox.c @@ -303,7 +303,7 @@ static const struct Applet applets[] = { {"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}, @@ -303,7 +303,7 @@ static const struct Applet applets[] = { {"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}, @@ -83,6 +83,7 @@ cmdedit_setwidth(int w) 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); } @@ -378,6 +379,7 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) 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)); @@ -589,6 +591,7 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) } nr = len + 1; + /* sparc and other have broken termios support: use old termio handling. */ ioctl(inputFd, TCSETA, (void *) &old_term); reset_term = 0; diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c index 64b7256..0f6afec 100644 --- a/console-tools/loadfont.c +++ b/console-tools/loadfont.c @@ -30,8 +30,8 @@ #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 */ @@ -47,6 +47,10 @@ extern int loadfont_main(int argc, char **argv) { 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)); diff --git a/docs/Makefile b/docs/Makefile index 10550f6..472d29e 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,7 +2,7 @@ # ------------------------ # Copyright (C) 2000 Erik Andersen <andersee@debian.org> GPL -all:: clean doc +all: clean doc doc: @echo @@ -14,10 +14,8 @@ doc: 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 - diff --git a/docs/busybox.pod b/docs/busybox.pod index 06800c3..a946e28 100644 --- a/docs/busybox.pod +++ b/docs/busybox.pod @@ -68,7 +68,7 @@ Example: ------------------------------- -=item cat +=item cat Usage: cat [file ...] @@ -807,19 +807,22 @@ Example: =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 ------------------------------- @@ -1294,7 +1297,7 @@ Usage: sh lash -- the BusyBox LAme SHell (command interpreter) -FIXME +FIXME -- this command does not yet have proper documentation ------------------------------- @@ -1778,4 +1781,4 @@ Enrique Zanardi <ezanardi@ull.es> =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 $ @@ -230,6 +230,8 @@ extern int kill_main(int argc, char **argv) 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 @@ -120,7 +120,6 @@ static struct builtInCommand bltins[] = { {"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} @@ -30,8 +30,8 @@ #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 */ @@ -47,6 +47,10 @@ extern int loadfont_main(int argc, char **argv) { 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)); @@ -33,25 +33,17 @@ 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); } @@ -106,15 +98,11 @@ extern int more_main(int argc, char **argv) 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); diff --git a/procps/kill.c b/procps/kill.c index db48424..765a3f6 100644 --- a/procps/kill.c +++ b/procps/kill.c @@ -230,6 +230,8 @@ extern int kill_main(int argc, char **argv) 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 @@ -120,7 +120,6 @@ static struct builtInCommand bltins[] = { {"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} diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 1434c36..ebc6b96 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c @@ -83,6 +83,7 @@ cmdedit_setwidth(int w) 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); } @@ -378,6 +379,7 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) 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)); @@ -589,6 +591,7 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) } nr = len + 1; + /* sparc and other have broken termios support: use old termio handling. */ ioctl(inputFd, TCSETA, (void *) &old_term); reset_term = 0; diff --git a/shell/lash.c b/shell/lash.c index bbf5775..97db8af 100644 --- a/shell/lash.c +++ b/shell/lash.c @@ -120,7 +120,6 @@ static struct builtInCommand bltins[] = { {"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} diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 8827265..228d0a1 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -226,18 +226,20 @@ static void doSyslogd (void) } 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 == '<') { @@ -262,6 +264,7 @@ static void doSyslogd (void) /* Now log it */ logMessage(pri, line); + break; } close (fd); FD_CLR (fd, &readfds); @@ -226,18 +226,20 @@ static void doSyslogd (void) } 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 == '<') { @@ -262,6 +264,7 @@ static void doSyslogd (void) /* Now log it */ logMessage(pri, line); + break; } close (fd); FD_CLR (fd, &readfds); diff --git a/util-linux/more.c b/util-linux/more.c index d5711aa..f842149 100644 --- a/util-linux/more.c +++ b/util-linux/more.c @@ -33,25 +33,17 @@ 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); } @@ -106,15 +98,11 @@ extern int more_main(int argc, char **argv) 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); @@ -1364,7 +1364,8 @@ extern pid_t* findPidByName( char* pidName) 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 */ |