dante: Fix compile with glibc
[openwrt/openwrt.git] / package / network / utils / dante / patches / 210-deactivate-sched_setscheduler.patch
1 When compiled with glibc the config_scan.c wants to use the
2 cpupolicy2numeric() function which is only available when
3 HAVE_SCHED_SETSCHEDULER is set. It looks like the wrong define was used here.
4
5 This fixes a build problem with glibc in combination with the force
6 ac_cv_func_sched_setscheduler=no in the OpenWrt CONFIGURE_VARS.
7
8 --- a/lib/config_scan.c
9 +++ b/lib/config_scan.c
10 @@ -3891,7 +3891,7 @@ YY_RULE_SETUP
11 SERRX(0);
12
13 #else /* !SOCKS_CLIENT */
14 -#if HAVE_SCHED_SETAFFINITY
15 +#if HAVE_SCHED_SETSCHEDULER
16
17 BEGIN(0);
18
19 @@ -3899,9 +3899,9 @@ YY_RULE_SETUP
20 yyerrorx("unknown scheduling policy \"%s\"", yytext);
21
22 return SCHEDULEPOLICY;
23 -#else /* !HAVE_SCHED_SETAFFINITY */
24 +#else /* !HAVE_SCHED_SETSCHEDULER */
25 yyerrorx("setting cpu scheduling policy is not supported on this platform");
26 -#endif /* !HAVE_SCHED_SETAFFINITY */
27 +#endif /* !HAVE_SCHED_SETSCHEDULER */
28
29 #endif /* SOCKS_CLIENT */
30 }
31 --- a/lib/config_scan.l
32 +++ b/lib/config_scan.l
33 @@ -456,7 +456,7 @@ cpu {
34 SERRX(0);
35
36 #else /* !SOCKS_CLIENT */
37 -#if HAVE_SCHED_SETAFFINITY
38 +#if HAVE_SCHED_SETSCHEDULER
39
40 BEGIN(0);
41
42 @@ -464,9 +464,9 @@ cpu {
43 yyerrorx("unknown scheduling policy \"%s\"", yytext);
44
45 return SCHEDULEPOLICY;
46 -#else /* !HAVE_SCHED_SETAFFINITY */
47 +#else /* !HAVE_SCHED_SETSCHEDULER */
48 yyerrorx("setting cpu scheduling policy is not supported on this platform");
49 -#endif /* !HAVE_SCHED_SETAFFINITY */
50 +#endif /* !HAVE_SCHED_SETSCHEDULER */
51
52 #endif /* SOCKS_CLIENT */
53 }