[Olsr-dev] [PATCH v1 39/43] log: add olsr_closelog function
Ferry Huberts
(spam-protected)
Wed Nov 11 17:22:12 CET 2015
From: Ferry Huberts <(spam-protected)>
So that we can close the log during shutdown
Signed-off-by: Ferry Huberts <(spam-protected)>
---
src/log.h | 2 ++
src/unix/log.c | 8 ++++++++
src/win32/log.c | 3 +++
3 files changed, 13 insertions(+)
diff --git a/src/log.h b/src/log.h
index f42b68c..bf3e496 100644
--- a/src/log.h
+++ b/src/log.h
@@ -53,6 +53,8 @@
void olsr_openlog(const char *ident);
+void olsr_closelog(void);
+
#if defined SYSLOG_NUMBERING && SYSLOG_NUMBERING
void olsr_syslog_real(int level, const char *format, ...) __attribute__ ((format(printf, 2, 3)));
diff --git a/src/unix/log.c b/src/unix/log.c
index 780fd75..6123089 100644
--- a/src/unix/log.c
+++ b/src/unix/log.c
@@ -63,6 +63,14 @@ olsr_openlog(const char *ident __attribute__((unused)))
return;
}
+void olsr_closelog(void) {
+#ifndef __ANDROID__
+ closelog();
+#endif /* __ANDROID__ */
+
+ return;
+}
+
#if defined SYSLOG_NUMBERING && SYSLOG_NUMBERING
unsigned int olsr_syslog_ctr = 0;
diff --git a/src/win32/log.c b/src/win32/log.c
index 997a544..fa41fda 100644
--- a/src/win32/log.c
+++ b/src/win32/log.c
@@ -48,6 +48,9 @@ olsr_openlog(const char *Id __attribute__ ((unused)))
{
}
+void olsr_closelog(void) {
+}
+
void
olsr_syslog(int Level __attribute__ ((unused)), const char *Format __attribute__ ((unused)),...)
{
--
2.5.0
More information about the Olsr-dev
mailing list