summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /x11-plugins/wmmemfree/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'x11-plugins/wmmemfree/files')
-rw-r--r--x11-plugins/wmmemfree/files/wmmemfree-0.7-add-kernel-26-support.patch83
-rw-r--r--x11-plugins/wmmemfree/files/wmmemfree-0.7-fix-crash-when-there-is-no-swap.patch18
2 files changed, 101 insertions, 0 deletions
diff --git a/x11-plugins/wmmemfree/files/wmmemfree-0.7-add-kernel-26-support.patch b/x11-plugins/wmmemfree/files/wmmemfree-0.7-add-kernel-26-support.patch
new file mode 100644
index 000000000000..c4545d0654c6
--- /dev/null
+++ b/x11-plugins/wmmemfree/files/wmmemfree-0.7-add-kernel-26-support.patch
@@ -0,0 +1,83 @@
+diff -Naur wmmemfree-0.7/mem_linux.c wmmemfree-0.7.new/mem_linux.c
+--- wmmemfree-0.7/mem_linux.c 2003-03-17 14:23:05.000000000 +0100
++++ wmmemfree-0.7/mem_linux.c 2004-08-28 23:18:56.783772744 +0200
+@@ -20,24 +20,48 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
++
++long int mem_total, mem_used, mem_free, mem_buffers, mem_cached;
++long int swp_total, swp_used, swp_free;
+
+-long long int mem_total, mem_used, mem_free, mem_shared, mem_buffers, mem_cached;
+-long long int swp_total, swp_used, swp_free;
+
+ void mem_getfree()
+ {
+- FILE *file;
++ FILE *memfp;
++
++ static char buf[1024];
++ static char *p_mem_tot=NULL, *p_mem_free, *p_mem_buffers, *p_mem_cache;
++ static char *p_swap_total, *p_swap_free;
++
++ memfp = fopen("/proc/meminfo", "r");
++ if (!memfp)
++ {
++ perror("/proc/meminfo");
++ exit(1);
++ }
++
++ fread_unlocked (buf, 1024, 1, memfp);
++ fclose(memfp);
++
++ if (!p_mem_tot)
++ {
++ p_mem_tot = strstr(buf, "MemTotal:" ) + 13;
++ p_mem_free = strstr(buf, "MemFree:" ) + 13;
++ p_mem_buffers = strstr(buf, "Buffers:" ) + 13;
++ p_mem_cache = strstr(buf, "Cached:" ) + 13;
++ p_swap_total = strstr(buf, "SwapTotal:") + 13;
++ p_swap_free = strstr(buf, "SwapFree:" ) + 13;
++ }
++
++ sscanf(p_mem_tot, "%ld", &mem_total );
++ sscanf(p_mem_free, "%ld", &mem_free );
++ sscanf(p_mem_buffers, "%ld", &mem_buffers);
++ sscanf(p_mem_cache, "%ld", &mem_cached );
++ sscanf(p_swap_total, "%ld", &swp_total );
++ sscanf(p_swap_free, "%ld", &swp_free );
++
++ mem_used = mem_total - mem_free;
++ swp_used = swp_total - swp_free;
+
+- file = fopen("/proc/meminfo", "r");
+- if(!file)
+- {
+- perror("/proc/meminfo");
+- exit(1);
+- }
+- while(fgetc(file)!='\n'){}
+- fscanf(file, "%*s %Ld %Ld %Ld %Ld %Ld %Ld",
+- &mem_total, &mem_used, &mem_free, &mem_shared, &mem_buffers, &mem_cached);
+- fscanf(file, "%*s %Ld %Ld %Ld",
+- &swp_total, &swp_used, &swp_free);
+- fclose(file);
+ }
+diff -Naur wmmemfree-0.7/mem_linux.h wmmemfree-0.7.new/mem_linux.h
+--- wmmemfree-0.7/mem_linux.h 2003-03-22 19:51:35.000000000 +0100
++++ wmmemfree-0.7/mem_linux.h 2004-08-28 23:12:19.066235000 +0200
+@@ -21,9 +21,9 @@
+ #ifndef __MEM_LINUX_H__
+ #define __MEM_LINUX_H__
+
+-extern long long int mem_total, mem_used;
+-extern long long int mem_shared, mem_buffers, mem_cached;
+-extern long long int swp_total, swp_used;
++extern long int mem_total, mem_used;
++extern long int mem_buffers, mem_cached;
++extern long int swp_total, swp_used;
+
+ void mem_getfree();
+
diff --git a/x11-plugins/wmmemfree/files/wmmemfree-0.7-fix-crash-when-there-is-no-swap.patch b/x11-plugins/wmmemfree/files/wmmemfree-0.7-fix-crash-when-there-is-no-swap.patch
new file mode 100644
index 000000000000..d062fd9ee09b
--- /dev/null
+++ b/x11-plugins/wmmemfree/files/wmmemfree-0.7-fix-crash-when-there-is-no-swap.patch
@@ -0,0 +1,18 @@
+--- wmmemfree-0.7/draw.c 2003-03-21 21:56:25.000000000 +0100
++++ wmmemfree-0.7/draw.c 2008-02-16 10:02:51.000000000 +0100
+@@ -44,13 +44,13 @@
+ XCopyArea(display, on, buffer, gc, 0, 0, 2, 11, 7 + n * 2, 27);
+ else
+ XCopyArea(display, off, buffer, gc, 0, 0, 2, 11, 7 + n * 2, 27);
+- if(n < (swp * 25 / swp_total))
++ if(n < ((swp_total) ? (swp * 25 / swp_total) : 0))
+ XCopyArea(display, on, buffer, gc, 0, 0, 2, 11, 7 + n * 2, 47);
+ else
+ XCopyArea(display, off, buffer, gc, 0, 0, 2, 11, 7 + n * 2, 47);
+ }
+ mem_percent = mem * 100 / mem_total;
+- swp_percent = swp * 100 / swp_total;
++ swp_percent = (swp_total) ? swp * 100 / swp_total : 0;
+ if(mem_percent == 100)
+ XCopyArea(display, numbers, buffer, gc, 5, 0, 5, 6, 33, 20);
+ else