aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-11-25 08:06:22 +0000
committerEric Andersen <andersen@codepoet.org>1999-11-25 08:06:22 +0000
commitbefda6e4ed06697f20fc114718ef0c92c5c6e56a (patch)
tree655d3ba8ac9b35679a23fccf019490e5462d192a
parent3843e96252a823b4fdfc89c61d00342bf011ad88 (diff)
downloadbusybox-befda6e4ed06697f20fc114718ef0c92c5c6e56a.tar.gz
Stuf
-rw-r--r--Changelog2
-rw-r--r--Makefile4
-rw-r--r--TODO5
-rw-r--r--busybox.def.h4
-rw-r--r--busybox.spec2
-rw-r--r--examples/busybox.spec2
-rw-r--r--logger.c26
-rw-r--r--sysklogd/logger.c26
8 files changed, 47 insertions, 24 deletions
diff --git a/Changelog b/Changelog
index cef86ec66..60bb73cf0 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,6 @@
0.37
+ * Wrote a micro syslogd, and a logger util (to log things to the syslog
+ from the command line or scripts) With both compiled in, costs 4k.
* Fixed 'make install' so symlinks are installed in their proper locations.
* Changed the build system slightly so that features can now be enabled
or disabled from the busybox.defs.h header file, without trying to
diff --git a/Makefile b/Makefile
index 1413ea05d..a754c2008 100644
--- a/Makefile
+++ b/Makefile
@@ -17,12 +17,12 @@
PROG=busybox
-VERSION=0.36
+VERSION=0.37
BUILDTIME=$(shell date "+%Y%m%d-%H%M")
# Comment out the following to make a debuggable build
# Leave this off for production use.
-DODEBUG=true
+DODEBUG=false
# If you want a static binary, turn this on. I can't think
# of many situations where anybody would ever want it static,
# but...
diff --git a/TODO b/TODO
index 20cd41ea3..44525cf32 100644
--- a/TODO
+++ b/TODO
@@ -1,9 +1,10 @@
TODO list for busybox in no particular order
-* Add in a mini syslogd
+If you have any good ideas, please let me know.
+
* Allow tar to create archives with sockets, devices, and other special files
* Add in a mini modprobe, insmod, rmmod
* poweroff
* Change init so halt, reboot (and poweroff) work with an initrd
when init is not PID 1
-*
+*
diff --git a/busybox.def.h b/busybox.def.h
index bf8f54556..0e7f349d4 100644
--- a/busybox.def.h
+++ b/busybox.def.h
@@ -28,7 +28,7 @@
#define BB_LN
#define BB_LOADFONT
#define BB_LOADKMAP
-#define BB_LOGGER
+//#define BB_LOGGER
#define BB_LS
//#define BB_MAKEDEVS
//#define BB_MATH
@@ -54,7 +54,7 @@
#define BB_SLEEP
#define BB_SWAPONOFF
#define BB_SYNC
-#define BB_SYSLOGD
+//#define BB_SYSLOGD
#define BB_TAR
#define BB_TOUCH
#define BB_TRUE_FALSE
diff --git a/busybox.spec b/busybox.spec
index 4a3ef6579..92000e7f4 100644
--- a/busybox.spec
+++ b/busybox.spec
@@ -1,5 +1,5 @@
Name: busybox
-Version: 0.36
+Version: 0.37
Release: 1
Group: System/Utilities
Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary.
diff --git a/examples/busybox.spec b/examples/busybox.spec
index 4a3ef6579..92000e7f4 100644
--- a/examples/busybox.spec
+++ b/examples/busybox.spec
@@ -1,5 +1,5 @@
Name: busybox
-Version: 0.36
+Version: 0.37
Release: 1
Group: System/Utilities
Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary.
diff --git a/logger.c b/logger.c
index 0683838cc..dfbc557ec 100644
--- a/logger.c
+++ b/logger.c
@@ -118,13 +118,17 @@ extern int logger_main(int argc, char **argv)
{
struct sockaddr_un sunx;
int fd, pri = LOG_USER|LOG_NOTICE;
+ int fromStdinFlag=FALSE;
int toStdErrFlag=FALSE;
- char *message, buf[1024];
+ char *message, buf[1024], buf1[1024];
time_t now;
size_t addrLength;
/* Parse any options */
while (--argc > 0 && **(++argv) == '-') {
+ if (*((*argv)+1) == '\0') {
+ fromStdinFlag=TRUE;
+ }
while (*(++(*argv))) {
switch (**argv) {
case 's':
@@ -146,15 +150,21 @@ extern int logger_main(int argc, char **argv)
}
}
- if (argc>=1)
- if (**argv=='-') {
- /* read from stdin */
+ if (fromStdinFlag==TRUE) {
+ /* read from stdin */
+ int i=0;
+ char c;
+ while ((c = getc(stdin)) != EOF && i<sizeof(buf1)) {
+ buf1[i++]=c;
+ }
+ message=buf1;
+ } else {
+ if (argc>=1) {
+ message=*argv;
} else {
- message=*argv;
+ fprintf(stderr, "No message\n");
+ exit( FALSE);
}
- else {
- fprintf(stderr, "No message\n");
- exit( FALSE);
}
memset(&sunx, 0, sizeof(sunx));
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index 0683838cc..dfbc557ec 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -118,13 +118,17 @@ extern int logger_main(int argc, char **argv)
{
struct sockaddr_un sunx;
int fd, pri = LOG_USER|LOG_NOTICE;
+ int fromStdinFlag=FALSE;
int toStdErrFlag=FALSE;
- char *message, buf[1024];
+ char *message, buf[1024], buf1[1024];
time_t now;
size_t addrLength;
/* Parse any options */
while (--argc > 0 && **(++argv) == '-') {
+ if (*((*argv)+1) == '\0') {
+ fromStdinFlag=TRUE;
+ }
while (*(++(*argv))) {
switch (**argv) {
case 's':
@@ -146,15 +150,21 @@ extern int logger_main(int argc, char **argv)
}
}
- if (argc>=1)
- if (**argv=='-') {
- /* read from stdin */
+ if (fromStdinFlag==TRUE) {
+ /* read from stdin */
+ int i=0;
+ char c;
+ while ((c = getc(stdin)) != EOF && i<sizeof(buf1)) {
+ buf1[i++]=c;
+ }
+ message=buf1;
+ } else {
+ if (argc>=1) {
+ message=*argv;
} else {
- message=*argv;
+ fprintf(stderr, "No message\n");
+ exit( FALSE);
}
- else {
- fprintf(stderr, "No message\n");
- exit( FALSE);
}
memset(&sunx, 0, sizeof(sunx));