]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: haproxy: using _GNU_SOURCE instead of __USE_GNU macro.
authorDavid Carlier <devnexen@gmail.com>
Tue, 8 Dec 2015 21:43:09 +0000 (21:43 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 9 Dec 2015 09:38:29 +0000 (10:38 +0100)
In order to properly enable sched_setaffinity, in some versions of Linux,
it is rather _GNU_SOURCE than __USE_GNU (spotted on Alpine Linux for instance),
also for the sake of consistency as __USE_GNU seems not used across the code and
for last, it seems on Linux it is the best way to enable non portable code.
On Linux glibc's based versions, it seems _GNU_SOURCE defines __USE_GNU
it should be safe enough.

src/haproxy.c

index 04bfabd033727cae3f816e98001ca571fd0b8e8a..5cd337998b2f27ac4f72d018a80773c70cb8b174 100644 (file)
@@ -25,6 +25,7 @@
  *
  */
 
+#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -47,9 +48,7 @@
 #include <syslog.h>
 #include <grp.h>
 #ifdef USE_CPU_AFFINITY
-#define __USE_GNU
 #include <sched.h>
-#undef __USE_GNU
 #ifdef __FreeBSD__
 #include <sys/param.h>
 #include <sys/cpuset.h>