summaryrefslogtreecommitdiffstats
path: root/package/liblog4c-localtime/0002-Fix-linking-error-without-pthread.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/liblog4c-localtime/0002-Fix-linking-error-without-pthread.patch')
-rw-r--r--package/liblog4c-localtime/0002-Fix-linking-error-without-pthread.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/package/liblog4c-localtime/0002-Fix-linking-error-without-pthread.patch b/package/liblog4c-localtime/0002-Fix-linking-error-without-pthread.patch
new file mode 100644
index 0000000000..3a4ef581a1
--- /dev/null
+++ b/package/liblog4c-localtime/0002-Fix-linking-error-without-pthread.patch
@@ -0,0 +1,36 @@
+From 435b28cd90973cc03a533e75e90a46cd9f197dff Mon Sep 17 00:00:00 2001
+From: Peter Korsgaard <peter@korsgaard.com>
+Date: Sat, 25 Oct 2014 19:44:01 +0200
+Subject: [PATCH 2/5] Fix linking error without pthread
+
+The rollingfile functionality only gets built if pthread support is
+available, but a call to these functions from log4c_fini() was outside
+the #if WITH_ROLLINGFILE conditional, causing linker errors when the
+library is used.
+
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ src/log4c/init.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/log4c/init.c b/src/log4c/init.c
+index 99883ea..7dd9eb4 100644
+--- a/src/log4c/init.c
++++ b/src/log4c/init.c
+@@ -267,10 +267,12 @@ extern int log4c_fini(void)
+ log4c_layout_factory = NULL;
+ }
+
++#ifdef WITH_ROLLINGFILE
+ if (log4c_rollingpolicy_factory) {
+ sd_factory_delete(log4c_rollingpolicy_factory);
+ log4c_rollingpolicy_factory = NULL;
+ }
++#endif
+
+ #ifdef __SD_DEBUG__
+ if( getenv("SD_DEBUG")){
+--
+2.0.0
+
OpenPOWER on IntegriCloud