mirror of
https://github.com/troglobit/finit.git
synced 2026-11-19 19:40:50 +00:00
Minor, staticify, reduce includes and allow debug to kmsg
The loglevel setting should control all logging, regardless of where we target it. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
3ed291789c
commit
e0a65f67c9
1 file changed
+3
-3
@@ -22,7 +22,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <sched.h> /* sched_yield() */
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <lite/lite.h>
|
#include <lite/lite.h>
|
||||||
@@ -56,7 +55,7 @@ void log_exit(void)
|
|||||||
enable_progress(1);
|
enable_progress(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void log_open(void)
|
static void log_open(void)
|
||||||
{
|
{
|
||||||
int opts = LOG_PID;
|
int opts = LOG_PID;
|
||||||
|
|
||||||
@@ -100,11 +99,12 @@ void logit(int prio, const char *fmt, ...)
|
|||||||
if (up || fexist("/dev/log")) {
|
if (up || fexist("/dev/log")) {
|
||||||
if (!up)
|
if (!up)
|
||||||
log_open();
|
log_open();
|
||||||
|
|
||||||
vsyslog(prio, fmt, ap);
|
vsyslog(prio, fmt, ap);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!debug && prio > loglevel)
|
if (prio > loglevel)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
fp = fopen("/dev/kmsg", "w");
|
fp = fopen("/dev/kmsg", "w");
|
||||||
|
|||||||
Reference in new issue
Block a user