Files
libgtop/debian/patches/03_mem_values.dpatch
2004-03-27 12:24:05 +00:00

39 lines
1.2 KiB
Plaintext

#!/bin/sh -e
## 03_mem_values.dpatch by Sebastien Bacher <seb128@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
case "$1" in
-patch) patch $patch_opts -p1 < $0;;
-unpatch) patch $patch_opts -p1 -R < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1;;
esac
exit 0
@DPATCH@
diff -urNad /tmp/libgtop2-2.0.8/sysdeps/linux/mem.c libgtop2-2.0.8/sysdeps/linux/mem.c
--- /tmp/libgtop2-2.0.8/sysdeps/linux/mem.c 2003-10-20 22:41:06.000000000 +0200
+++ libgtop2-2.0.8/sysdeps/linux/mem.c 2004-01-01 13:30:47.000000000 +0100
@@ -66,8 +66,8 @@
buffer [len] = '\0';
buf->total = get_scaled(buffer, "MemTotal:");
- buf->used = get_scaled(buffer, "Active:");
buf->free = get_scaled(buffer, "MemFree:");
+ buf->used = buf->total - buf->free;
buf->shared = get_scaled(buffer, "Mapped:");
buf->buffer = get_scaled(buffer, "Buffers:");
buf->cached = get_scaled(buffer, "Cached:");