[PATCH 3/3] syslogd: add option to log to Linux kernel printk buffer
Peter Korsgaard
jacmet at sunsite.dk
Sat Jan 5 22:05:23 UTC 2013
>>>>> "Mike" == Mike Frysinger <vapier at gentoo.org> writes:
Mike> On Tuesday 18 December 2012 14:49:20 Peter Korsgaard wrote:
>> + /*
>> + kernel < 3.5 expects single char printk KERN_* priority prefix,
>> + from 3.5 onwards the full syslog facility/priority format is supported
>> + */
Mike> comment style is slightly off. needs '*' at the start of each line.
Ok, will fix.
>> + if (get_linux_version_code() < KERNEL_VERSION(3,5,0))
>> + pri &= LOG_PRIMASK;
>> +
>> + write(G.kmsgfd, G.printbuf, sprintf(G.printbuf, "<%d>%s\n", pri, msg));
Mike> so this calls uname() every time we write() ? can't this be
Mike> optimized a bit ?
Sure, I'll move it to an init function.
Thanks for review, will fixup and resend.
--
Bye, Peter Korsgaard
More information about the busybox
mailing list