0002-ipc-enable-gnu-source.patch 921 B

12345678910111213141516171819202122232425262728
  1. https://github.com/collectd/collectd/commit/3e3848349b753d78a0b1d19648fb394866856bda
  2. ipc: enable _GNU_SOURCE to fix build with musl libc
  3. This fixes compile the compile error:
  4. > ipc.c:154:49: error: 'struct shm_info' has no member named 'used_ids'
  5. > ipc_submit_g("shm", "segments", NULL, shm_info.used_ids);
  6. > ^
  7. Fixes #1147
  8. Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
  9. diff --git a/src/ipc.c b/src/ipc.c
  10. index 3763f24..b403847 100644
  11. --- a/src/ipc.c
  12. +++ b/src/ipc.c
  13. @@ -32,6 +32,9 @@
  14. #include "configfile.h"
  15. #if KERNEL_LINUX
  16. + /* _GNU_SOURCE is needed for struct shm_info.used_ids on musl libc */
  17. +# define _GNU_SOURCE
  18. +
  19. /* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
  20. /* X/OPEN tells us to use <sys/{types,ipc,msg}.h> for msgctl() */
  21. /* X/OPEN tells us to use <sys/{types,ipc,shm}.h> for shmctl() */