0002-Fix-linking-error-without-pthread.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 435b28cd90973cc03a533e75e90a46cd9f197dff Mon Sep 17 00:00:00 2001
  2. From: Peter Korsgaard <peter@korsgaard.com>
  3. Date: Sat, 25 Oct 2014 19:44:01 +0200
  4. Subject: [PATCH 2/5] Fix linking error without pthread
  5. The rollingfile functionality only gets built if pthread support is
  6. available, but a call to these functions from log4c_fini() was outside
  7. the #if WITH_ROLLINGFILE conditional, causing linker errors when the
  8. library is used.
  9. Submitted upstream: https://github.com/rcmadruga/log4c-localtime/pull/1
  10. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  11. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  12. ---
  13. src/log4c/init.c | 2 ++
  14. 1 file changed, 2 insertions(+)
  15. diff --git a/src/log4c/init.c b/src/log4c/init.c
  16. index 99883ea..7dd9eb4 100644
  17. --- a/src/log4c/init.c
  18. +++ b/src/log4c/init.c
  19. @@ -267,10 +267,12 @@ extern int log4c_fini(void)
  20. log4c_layout_factory = NULL;
  21. }
  22. +#ifdef WITH_ROLLINGFILE
  23. if (log4c_rollingpolicy_factory) {
  24. sd_factory_delete(log4c_rollingpolicy_factory);
  25. log4c_rollingpolicy_factory = NULL;
  26. }
  27. +#endif
  28. #ifdef __SD_DEBUG__
  29. if( getenv("SD_DEBUG")){
  30. --
  31. 2.0.0