projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
udevtrigger: simplify scan_subsystem function
[project/procd.git]
/
syslog.c
diff --git
a/syslog.c
b/syslog.c
index
a558e50
..
01b6e7e
100644
(file)
--- a/
syslog.c
+++ b/
syslog.c
@@
-46,8
+46,8
@@
static char *log_dev = LOG_DEFAULT_SOCKET;
static int log_size = LOG_DEFAULT_SIZE;
static struct log_head *log, *log_end, *oldest, *newest;
static int current_id = 0;
static int log_size = LOG_DEFAULT_SIZE;
static struct log_head *log, *log_end, *oldest, *newest;
static int current_id = 0;
-regex_t pat_prio;
-regex_t pat_tstamp;
+
static
regex_t pat_prio;
+
static
regex_t pat_tstamp;
static struct log_head *log_next(struct log_head *h, int size)
{
static struct log_head *log_next(struct log_head *h, int size)
{
@@
-165,12
+165,12
@@
static void klog_cb(struct ustream *s, int bytes)
struct ustream_fd slog = {
.stream.string_data = true,
struct ustream_fd slog = {
.stream.string_data = true,
-
.stream.notify_read = slog_cb,
+ .stream.notify_read = slog_cb,
};
struct ustream_fd klog = {
.stream.string_data = true,
};
struct ustream_fd klog = {
.stream.string_data = true,
-
.stream.notify_read = klog_cb,
+ .stream.notify_read = klog_cb,
};
static int klog_open(void)
};
static int klog_open(void)
@@
-262,11
+262,6
@@
int log_buffer_init(int size)
return 0;
}
return 0;
}
-int log_buffer_size(void)
-{
- return log_size;
-}
-
void log_init(void)
{
regcomp(&pat_prio, "^<([0-9]*)>(.*)", REG_EXTENDED);
void log_init(void)
{
regcomp(&pat_prio, "^<([0-9]*)>(.*)", REG_EXTENDED);
@@
-279,5
+274,13
@@
void log_init(void)
syslog_open();
klog_open();
syslog_open();
klog_open();
- openlog("procd", LOG_PID, LOG_DAEMON);
+ openlog("sysinit", LOG_CONS, LOG_DAEMON);
+}
+
+void log_shutdown(void)
+{
+ ustream_free(&slog.stream);
+ ustream_free(&klog.stream);
+ close(slog.fd.fd);
+ close(klog.fd.fd);
}
}