0002-Replace-__sched_priority-with-sched_priority-fixes-m.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From cca93ce25f993c97ef3d96fa32461d5717c30518 Mon Sep 17 00:00:00 2001
  2. From: Luca Ceresoli <luca@lucaceresoli.net>
  3. Date: Sat, 12 Mar 2016 15:31:47 +0100
  4. Subject: [PATCH 2/2] Replace __sched_priority with sched_priority(fixes musl
  5. build)
  6. The musl C library defines sched_priority, not __sched_priority as GNU
  7. libc and uClibc-ng do. Use sched_priority instead.
  8. This does not break compatibility with GNU libc and uClibc-ng because
  9. both define in sched.h:
  10. #define sched_priority __sched_priority
  11. Fixes the following build errors when building with musl:
  12. ../src/samples/siprtp.c: In function 'boost_priority':
  13. ../src/samples/siprtp.c:1137:7: error: 'struct sched_param' has no member named '__sched_priority'
  14. tp.__sched_priority = max_prio;
  15. ^
  16. In file included from /home/murray/devel/buildroot/test-musl-eabi/build/libpjsip-2.4.5/pjlib/include/pj/except.h:30:0,
  17. from /home/murray/devel/buildroot/test-musl-eabi/build/libpjsip-2.4.5/pjlib/include/pjlib.h:35,
  18. from ../src/samples/siprtp.c:76:
  19. ../src/samples/siprtp.c:1146:18: error: 'struct sched_param' has no member named '__sched_priority'
  20. policy, tp.__sched_priority));
  21. ^
  22. Original patch:
  23. http://git.alpinelinux.org/cgit/aports/plain/main/pjproject/musl-fixes.patch
  24. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
  25. ---
  26. pjsip-apps/src/samples/siprtp.c | 10 +++++-----
  27. 1 file changed, 5 insertions(+), 5 deletions(-)
  28. diff --git a/pjsip-apps/src/samples/siprtp.c b/pjsip-apps/src/samples/siprtp.c
  29. index 796464f..6e32a8f 100644
  30. --- a/pjsip-apps/src/samples/siprtp.c
  31. +++ b/pjsip-apps/src/samples/siprtp.c
  32. @@ -1134,7 +1134,7 @@ static void boost_priority(void)
  33. PJ_RETURN_OS_ERROR(rc));
  34. return;
  35. }
  36. - tp.__sched_priority = max_prio;
  37. + tp.sched_priority = max_prio;
  38. rc = sched_setscheduler(0, POLICY, &tp);
  39. if (rc != 0) {
  40. @@ -1143,7 +1143,7 @@ static void boost_priority(void)
  41. }
  42. PJ_LOG(4, (THIS_FILE, "New process policy=%d, priority=%d",
  43. - policy, tp.__sched_priority));
  44. + policy, tp.sched_priority));
  45. /*
  46. * Adjust thread scheduling algorithm and priority
  47. @@ -1156,10 +1156,10 @@ static void boost_priority(void)
  48. }
  49. PJ_LOG(4, (THIS_FILE, "Old thread policy=%d, priority=%d",
  50. - policy, tp.__sched_priority));
  51. + policy, tp.sched_priority));
  52. policy = POLICY;
  53. - tp.__sched_priority = max_prio;
  54. + tp.sched_priority = max_prio;
  55. rc = pthread_setschedparam(pthread_self(), policy, &tp);
  56. if (rc != 0) {
  57. @@ -1169,7 +1169,7 @@ static void boost_priority(void)
  58. }
  59. PJ_LOG(4, (THIS_FILE, "New thread policy=%d, priority=%d",
  60. - policy, tp.__sched_priority));
  61. + policy, tp.sched_priority));
  62. }
  63. #else
  64. --
  65. 1.9.1