Workaround for Linux 3.14
authornorly <ny-git@enpas.org>
Wed, 28 May 2014 19:11:11 +0000 (21:11 +0200)
committernorly <ny-git@enpas.org>
Wed, 28 May 2014 19:11:11 +0000 (21:11 +0200)
src/status/memusage.c

index 6e715145aa6940a91e98db092505ce379fb96898..15523de20008e1e42c3d93b9a682ef355457ac25 100644 (file)
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "common.h"
 #include "tools.h"
@@ -33,6 +34,9 @@ void status_memusage(GlobalData *g)
     memfree = atoi(&stline[17]);
 
     stlen = getline(&stline, &stlen, stfile);
+    if (stlen > 13 && !memcmp(stline, "MemAvailable:", 13)) {
+      stlen = getline(&stline, &stlen, stfile);
+    }
     membuffers = atoi(&stline[17]);
 
     stlen = getline(&stline, &stlen, stfile);