[Pkg-libvirt-commits] [libguestfs] 14/179: tools: fix free -m invocation
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 31 19:07:54 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch experimental
in repository libguestfs.
commit cb1b7cbdd5f92ee41ba70915d74dfa845d2365ae
Author: Pino Toscano <ptoscano at redhat.com>
Date: Mon Oct 6 16:10:44 2014 +0200
tools: fix free -m invocation
Since procps 3.3.10, free does not output the "-/+ buffers/cache" line
anymore. On the other hand, the data from it can be calculated from the
memory values, so just do the calculation manually (with awk).
---
df/estimate-max-threads.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/df/estimate-max-threads.c b/df/estimate-max-threads.c
index bbcdd73..7d5b090 100644
--- a/df/estimate-max-threads.c
+++ b/df/estimate-max-threads.c
@@ -44,7 +44,7 @@ estimate_max_threads (void)
/* Choose the number of threads based on the amount of free memory. */
mbytes_str = read_line_from ("LANG=C free -m | "
- "grep 'buffers/cache' | awk '{print $NF}'");
+ "grep '^Mem' | awk '{print $4+$6+$7}'");
if (mbytes_str == NULL)
return 1;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list