On Friday 30 July 2010 22:07, Jeremie Koenig wrote:
> The klogctl() interface allows changing the console loglevel, but is
> Linux-specific. The more portable method of reading from _PATH_KLOG is
> added as an alternative.
+static void klogd_setloglevel(int lvl UNUSED_PARAM)
+{
+ FILE *f;
+
+ f = fopen("/proc/sys/kernel/printk", "w");
+ if (f != NULL) {
+ fprintf(f, "%d", lvl);
Apparently lvl is no longer UNUSED_PARAM :)
- n = klogctl(2, start, KLOGD_LOGBUF_SIZE-1 - used);
+ n = klogd_read(start, KLOGD_LOGBUF_SIZE-1 - used);
if (n < 0) {
if (errno == EINTR)
continue;
You needed to change the message as well:
syslog(LOG_ERR, "klogd: error %d in klogctl(2): %m",
errno);
I am applying it with some changes. Please test current git.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox