Package: swapd
Version: 0.2-10
Followup-For: Bug #227257

Dear maintainer, please consider this patch. It is for exactly what I
wanted. I use swapd rebuilt with this patch and it works great.

diff -uw swapd-0.2/meminfo.c swapd-0.2-1/meminfo.c
--- swapd-0.2/meminfo.c 2006-01-07 14:02:52.000000000 +0200
+++ swapd-0.2-1/meminfo.c       2006-01-07 13:50:49.000000000 +0200
@@ -38,7 +38,7 @@
 /*    static  int     fd       = -1;*/         /* fd to read meminfo from */
     static  char    buffer [ 10240 ];  /* enough to slurp meminfo into */
     char   *cp;
-    long    memfree, buffers, cached, swapfree;
+    long    memfree, swapfree;
     int     n;
 
     if ( fd < 0 ) {
@@ -60,8 +60,6 @@
     buffer[n] = '\0';                          /* null terminate */
 
     memfree = -1;
-    buffers = 0;
-    cached  = 0;
     swapfree = 0;
 
     cp = buffer;
@@ -72,16 +70,6 @@
         memfree = atol( cp+9 ) * 1024;
         /*printf( "MemFree: %ld\n", memfree );*/
     }
-    else if ( strncmp( cp, "Buffers:", 8 ) == 0 )
-    {
-        buffers = atol( cp+9 ) * 1024;
-        /*printf( "Buffers: %ld\n", buffers );*/
-    }
-    else if ( strncmp( cp, "Cached:", 7 ) == 0 )
-    {
-        cached = atol( cp+8 ) * 1024;
-        /*printf( "Cached: %ld\n", cached );*/
-    }
     else if ( strncmp( cp, "SwapFree:", 9 ) == 0 )
     {
         swapfree = atol( cp+10 ) * 1024;
@@ -96,6 +84,6 @@
     }
     }
 
-    return ( memfree + swapfree + ( buffers + cached ) / 2 );
+    return memfree + swapfree;
 }


-- System Information:
Debian Release: testing/unstable
  APT prefers breezy
  APT policy: (500, 'breezy'), (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14
Locale: LANG=uk_UA.UTF-8, LC_CTYPE=uk_UA.UTF-8 (charmap=UTF-8)

Versions of packages swapd depends on:
ii  libc6                         2.3.5-11   GNU C Library: Shared libraries an

swapd recommends no packages.

-- debconf-show failed


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to