svn commit: trunk/busybox/init
vda at busybox.net
vda at busybox.net
Tue Dec 9 21:23:31 UTC 2008
Author: vda
Date: 2008-12-09 13:23:31 -0800 (Tue, 09 Dec 2008)
New Revision: 24348
Log:
init: do not eat last char in messages;
do not print duplicate "init:" prefix to syslog
Modified:
trunk/busybox/init/init.c
Changeset:
Modified: trunk/busybox/init/init.c
===================================================================
--- trunk/busybox/init/init.c 2008-12-09 20:00:31 UTC (rev 24347)
+++ trunk/busybox/init/init.c 2008-12-09 21:23:31 UTC (rev 24348)
@@ -118,18 +118,18 @@
msg[0] = '\r';
va_start(arguments, fmt);
- l = vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments);
- if (l > sizeof(msg) - 2)
- l = sizeof(msg) - 2;
+ l = 1 + vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments);
+ if (l > sizeof(msg) - 1)
+ l = sizeof(msg) - 1;
msg[l] = '\0';
va_end(arguments);
if (ENABLE_FEATURE_INIT_SYSLOG) {
- /* Log the message to syslogd */
if (where & L_LOG) {
- /* don't print out "\r" */
- openlog(applet_name, 0, LOG_DAEMON);
- syslog(LOG_INFO, "init: %s", msg + 1);
+ /* Log the message to syslogd */
+ openlog("init", 0, LOG_DAEMON);
+ /* don't print "\r" */
+ syslog(LOG_INFO, "%s", msg + 1);
closelog();
}
msg[l++] = '\n';
More information about the busybox-cvs
mailing list