diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-12-08 19:35:51 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-12-08 19:35:51 +0000 |
commit | 9cff4fbac91bdd63acbed23b732d76c56177ca62 (patch) | |
tree | aa6dac97487324c215bea690e8ad73c99e0c487c | |
parent | 5e09b6e3a83c83fe3db99ef9f8b2cdf6dc21cec4 (diff) | |
download | busybox-w32-9cff4fbac91bdd63acbed23b732d76c56177ca62.tar.gz busybox-w32-9cff4fbac91bdd63acbed23b732d76c56177ca62.tar.bz2 busybox-w32-9cff4fbac91bdd63acbed23b732d76c56177ca62.zip |
Patch from Matt Kraai to make logger log all arguments.
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | logger.c | 15 | ||||
-rw-r--r-- | sysklogd/logger.c | 15 |
3 files changed, 25 insertions, 6 deletions
@@ -45,6 +45,7 @@ | |||
45 | * Mark Whitley -- remix of xargs | 45 | * Mark Whitley -- remix of xargs |
46 | * Jim Gleason <jimg@lineo.com> -- fixed tar so it no longer breaks | 46 | * Jim Gleason <jimg@lineo.com> -- fixed tar so it no longer breaks |
47 | hard links. | 47 | hard links. |
48 | * Matt Kraai -- logger now logs all arguments, not just the first | ||
48 | 49 | ||
49 | 50 | ||
50 | -Erik Andersen | 51 | -Erik Andersen |
@@ -149,10 +149,19 @@ extern int logger_main(int argc, char **argv) | |||
149 | } | 149 | } |
150 | message = buf; | 150 | message = buf; |
151 | } else { | 151 | } else { |
152 | if (argc >= 1) | 152 | if (argc >= 1) { |
153 | message = *argv; | 153 | int len = 1; /* for the '\0' */ |
154 | else | 154 | for (; *argv != NULL; argv++) { |
155 | len += strlen(*argv); | ||
156 | len += 1; /* for the space between the args */ | ||
157 | message = xrealloc(message, len); | ||
158 | strcat(message, *argv); | ||
159 | strcat(message, " "); | ||
160 | } | ||
161 | message[strlen(message)-1] = '\0'; | ||
162 | } else { | ||
155 | error_msg_and_die("No message\n"); | 163 | error_msg_and_die("No message\n"); |
164 | } | ||
156 | } | 165 | } |
157 | 166 | ||
158 | openlog(name, option, (pri | LOG_FACMASK)); | 167 | openlog(name, option, (pri | LOG_FACMASK)); |
diff --git a/sysklogd/logger.c b/sysklogd/logger.c index 1ed6dc639..1c454e5af 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c | |||
@@ -149,10 +149,19 @@ extern int logger_main(int argc, char **argv) | |||
149 | } | 149 | } |
150 | message = buf; | 150 | message = buf; |
151 | } else { | 151 | } else { |
152 | if (argc >= 1) | 152 | if (argc >= 1) { |
153 | message = *argv; | 153 | int len = 1; /* for the '\0' */ |
154 | else | 154 | for (; *argv != NULL; argv++) { |
155 | len += strlen(*argv); | ||
156 | len += 1; /* for the space between the args */ | ||
157 | message = xrealloc(message, len); | ||
158 | strcat(message, *argv); | ||
159 | strcat(message, " "); | ||
160 | } | ||
161 | message[strlen(message)-1] = '\0'; | ||
162 | } else { | ||
155 | error_msg_and_die("No message\n"); | 163 | error_msg_and_die("No message\n"); |
164 | } | ||
156 | } | 165 | } |
157 | 166 | ||
158 | openlog(name, option, (pri | LOG_FACMASK)); | 167 | openlog(name, option, (pri | LOG_FACMASK)); |