Support for tar -z option for uncompressing only
[oweals/busybox.git] / logger.c
index 8e341efe9b58c522be2b57f66ef7a74f18f29edc..669a2d6010091551641ce11afa0b311524c0908e 100644 (file)
--- a/logger.c
+++ b/logger.c
@@ -35,7 +35,7 @@
 
 #else
 /* We have to do this since the header file defines static
- * structues.  Argh.... bad libc, bad, bad...
+ * structures.  Argh.... bad libc, bad, bad...
  */
 #include <sys/syslog.h>
 typedef struct _code {
@@ -85,14 +85,14 @@ static int pencode(char *s)
                *s = '\0';
                fac = decode(save, facilitynames);
                if (fac < 0)
-                       fatalError("unknown facility name: %s\n", save);
+                       error_msg_and_die("unknown facility name: %s\n", save);
                *s++ = '.';
        } else {
                s = save;
        }
        lev = decode(s, prioritynames);
        if (lev < 0)
-               fatalError("unknown priority name: %s\n", save);
+               error_msg_and_die("unknown priority name: %s\n", save);
        return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK));
 }
 
@@ -149,10 +149,19 @@ extern int logger_main(int argc, char **argv)
                }
                message = buf;
        } else {
-               if (argc >= 1)
-                       message = *argv;
-               else
-                       fatalError("No message\n");
+               if (argc >= 1) {
+                       int len = 1; /* for the '\0' */
+                       for (; *argv != NULL; argv++) {
+                               len += strlen(*argv);
+                               len += 1;  /* for the space between the args */
+                               message = xrealloc(message, len);
+                               strcat(message, *argv);
+                               strcat(message, " ");
+                       }
+                       message[strlen(message)-1] = '\0';
+               } else {
+                       error_msg_and_die("No message\n");
+               }
        }
 
        openlog(name, option, (pri | LOG_FACMASK));