]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix compile error in CPU affinity
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 15 Feb 2016 06:59:09 +0000 (19:59 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 15 Feb 2016 06:59:09 +0000 (19:59 +1300)
struct cpu_set_t may be defined (eg on Hurd) even if the CPU affinity API
is not fully existing, or a non-working stub.

compat/cpu.h

index f652aaff2e01bdcb66f932f7d3e1dfa635fb835a..e6e73f236cee73f9955f0b6beadc0885573b9abf 100644 (file)
 
 #if !HAVE_CPU_AFFINITY
 /* failing replacements to minimize the number of if-HAVE_CPU_AFFINITYs */
+#if !defined(__cpu_set_t_defined)
 typedef struct {
     int bits;
 } cpu_set_t;
+#endif
 inline int sched_setaffinity(int, size_t, cpu_set_t *) { return ENOTSUP; }
 inline int sched_getaffinity(int, size_t, cpu_set_t *) { return ENOTSUP; }
 #endif /* HAVE_CPU_AFFINITY */