You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

  1. From 21fab69d332bfafd0a214ee29d8ad0779a055988 Mon Sep 17 00:00:00 2001
  2. From: David Carlier <devnexen@gmail.com>
  3. Date: Tue, 8 Dec 2015 21:43:09 +0000
  4. Subject: [PATCH 13/13] CLEANUP: haproxy: using _GNU_SOURCE instead of
  5. __USE_GNU macro.
  6. In order to properly enable sched_setaffinity, in some versions of Linux,
  7. it is rather _GNU_SOURCE than __USE_GNU (spotted on Alpine Linux for instance),
  8. also for the sake of consistency as __USE_GNU seems not used across the code and
  9. for last, it seems on Linux it is the best way to enable non portable code.
  10. On Linux glibc's based versions, it seems _GNU_SOURCE defines __USE_GNU
  11. it should be safe enough.
  12. (cherry picked from commit 7ece096767d329d0ea04b70a1fb2c8b8a96b47e0)
  13. (cherry picked from commit 5a0ac35503f88a7bc8ee2c4f865354fa6cc25901)
  14. ---
  15. src/haproxy.c | 3 +--
  16. 1 file changed, 1 insertion(+), 2 deletions(-)
  17. diff --git a/src/haproxy.c b/src/haproxy.c
  18. index b94252d..20480a1 100644
  19. --- a/src/haproxy.c
  20. +++ b/src/haproxy.c
  21. @@ -25,6 +25,7 @@
  22. *
  23. */
  24. +#define _GNU_SOURCE
  25. #include <stdio.h>
  26. #include <stdlib.h>
  27. #include <unistd.h>
  28. @@ -47,9 +48,7 @@
  29. #include <syslog.h>
  30. #include <grp.h>
  31. #ifdef USE_CPU_AFFINITY
  32. -#define __USE_GNU
  33. #include <sched.h>
  34. -#undef __USE_GNU
  35. #endif
  36. #ifdef DEBUG_FULL
  37. --
  38. 2.4.10