]> arthur.barton.de Git - netdata.git/commitdiff
resolve compilation issues for musl libc #66
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 2 Apr 2016 02:53:21 +0000 (05:53 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 2 Apr 2016 02:53:21 +0000 (05:53 +0300)
src/common.h
src/web_server.c

index 9d8836f8bf9427ad9029c18b08ed1030afa1290b..2d5ac59c09442133e29eafd7b8c3ff525eeb688f 100755 (executable)
@@ -1,3 +1,6 @@
+#include <sys/time.h>
+#include <sys/resource.h>
+
 #ifndef NETDATA_COMMON_H
 #define NETDATA_COMMON_H 1
 
@@ -32,4 +35,11 @@ extern void get_HZ(void);
 
 extern pid_t gettid(void);
 
+/* fix for alpine linux */
+#ifndef RUSAGE_THREAD
+#ifdef RUSAGE_CHILDREN
+#define RUSAGE_THREAD RUSAGE_CHILDREN
+#endif
+#endif
+
 #endif /* NETDATA_COMMON_H */
index cae94acadd4c9edf689bb3aa9a97b09ede3bb222..031361402bdb13bdcb24acb16b68ee72d02812a8 100755 (executable)
@@ -30,6 +30,7 @@ int listen_backlog = LISTEN_BACKLOG;
 int listen_fd = -1;
 int listen_port = LISTEN_PORT;
 
+#ifdef NETDATA_INTERNAL_CHECKS
 static void log_allocations(void)
 {
        static int mem = 0;
@@ -46,6 +47,7 @@ static void log_allocations(void)
                mem = mi.uordblks;
        }
 }
+#endif
 
 int create_listen_socket4(int port, int listen_backlog)
 {
@@ -210,7 +212,9 @@ void *socket_listen_main(void *ptr)
                                debug(D_WEB_CLIENT, "%llu: Removing client.", w->id);
                                // pthread_join(w->thread,  NULL);
                                w = web_client_free(w);
+#ifdef NETDATA_INTERNAL_CHECKS
                                log_allocations();
+#endif
                        }
                }
        }