projects
/
project
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca6d547
)
ulog: implement ulog_close()
author
Jo-Philipp Wich
<
[email protected]
>
Thu, 26 Feb 2015 12:35:50 +0000
(13:35 +0100)
committer
Jo-Philipp Wich
<
[email protected]
>
Thu, 26 Feb 2015 12:35:50 +0000
(13:35 +0100)
Signed-off-by: Jo-Philipp Wich <
[email protected]
>
ulog.c
patch
|
blob
|
history
diff --git
a/ulog.c
b/ulog.c
index f7c92d80fddd03880c51311164e70da5b4627111..776a0c4e869d47890036e0b7e7fa2b6c5aaf14e5 100644
(file)
--- a/
ulog.c
+++ b/
ulog.c
@@
-121,11
+121,24
@@
static void ulog_syslog(int priority, const char *fmt, va_list ap)
void ulog_open(int channels, int facility, const char *ident)
{
+ ulog_close();
+
_ulog_channels = channels;
_ulog_facility = facility;
_ulog_ident = ident;
}
+void ulog_close(void)
+{
+ if (!_ulog_initialized)
+ return;
+
+ if (_ulog_channels & ULOG_SYSLOG)
+ closelog();
+
+ _ulog_initialized = 0;
+}
+
void ulog_threshold(int threshold)
{
_ulog_threshold = threshold;