Commits

Ahmad Khayyat committed eb057dc

screen: fix free memory in status line for OpenVZ

  • Participants
  • Parent commits cd80dcc

Comments (0)

Files changed (1)

File screen/screen-stats.awk

         # memory
         getline < memfile; total=$2;
         getline < memfile; free=$2;
-        getline < memfile; buffers=$2;
-        getline < memfile; cached=$2;
+        getline < memfile;
+        if ($1 == "Buffers:") {
+            buffers=$2;
+            getline < memfile;
+        } else
+            buffers=0;
+        cached=$2;
         notused = free + buffers + cached;
         mem = sprintf("%.0f", (total - notused) / total * 100);
         close(memfile);