log: add olsr_closelog function
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 10 Nov 2015 11:57:48 +0000 (12:57 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 11 Nov 2015 16:09:28 +0000 (17:09 +0100)
So that we can close the log during shutdown

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/log.h
src/unix/log.c
src/win32/log.c

index f42b68c..bf3e496 100644 (file)
--- 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)));
 
index 780fd75..6123089 100644 (file)
@@ -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;
index 997a544..fa41fda 100644 (file)
@@ -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)),...)
 {