X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fipc.c;h=00b3a5f8657a0e8d32ab76a41acbd43502368eb0;hb=2a28b85efff687d0753d816fcf89f6be01605db5;hp=3763f24837addb2a9b2f523093a49b745119cb78;hpb=cf33da9ad00ac94931a2c87563f8d007a996f1ad;p=collectd.git diff --git a/src/ipc.c b/src/ipc.c index 3763f248..00b3a5f8 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -32,6 +32,9 @@ #include "configfile.h" #if KERNEL_LINUX + /* _GNU_SOURCE is needed for struct shm_info.used_ids on musl libc */ +# define _GNU_SOURCE + /* X/OPEN tells us to use for semctl() */ /* X/OPEN tells us to use for msgctl() */ /* X/OPEN tells us to use for shmctl() */ @@ -210,7 +213,7 @@ static caddr_t ipc_get_info (cid_t cid, int cmd, int version, int stsize, int *n *nmemb = size / stsize; - buff = (caddr_t)malloc (size); + buff = malloc (size); if (buff == NULL) { ERROR ("ipc plugin: ipc_get_info malloc failed."); return (NULL); @@ -295,7 +298,7 @@ static int ipc_read_msg (void) /* {{{ */ msg_alloc_queues++; msg_used_space += ipcinfo_msg[i].msg_cbytes; msg_qnum += ipcinfo_msg[i].msg_qnum; - + } free(ipcinfo_msg); ipc_submit_g("msg", "count", "queues", msg_alloc_queues);