Stuf
authorEric Andersen <andersen@codepoet.org>
Thu, 25 Nov 1999 08:06:22 +0000 (08:06 -0000)
committerEric Andersen <andersen@codepoet.org>
Thu, 25 Nov 1999 08:06:22 +0000 (08:06 -0000)
Changelog
Makefile
TODO
busybox.def.h
busybox.spec
examples/busybox.spec
logger.c
sysklogd/logger.c

index cef86ec..60bb73c 100644 (file)
--- 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 
index 1413ea0..a754c20 100644 (file)
--- a/Makefile
+++ b/Makefile
 
 
 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 20cd41e..44525cf 100644 (file)
--- 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
-* 
+*   
index bf8f545..0e7f349 100644 (file)
@@ -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
index 4a3ef65..92000e7 100644 (file)
@@ -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.
index 4a3ef65..92000e7 100644 (file)
@@ -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.
index 0683838..dfbc557 100644 (file)
--- 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));
index 0683838..dfbc557 100644 (file)
@@ -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));