[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/ksysguard/ksysguardd/Linux
From: John Tapsell <john.tapsell () kdemail ! net>
Date: 2009-08-25 22:25:28
Message-ID: 1251239128.986757.16739.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1015599 by johnflux:
Make sure we close our opendir's
M +5 -1 ProcessList.c
M +3 -0 acpi.c
M +1 -0 logfile.c
M +2 -1 stat.c
--- trunk/KDE/kdebase/workspace/ksysguard/ksysguardd/Linux/ProcessList.c \
#1015598:1015599 @@ -282,7 +282,10 @@
/*There was a "(ps->vmRss+3) * sysconf(_SC_PAGESIZE)" here originally. I have no \
idea why! After comparing it to meminfo and other tools, this means we report the \
RSS by 12 bytes different compared to them. So I'm removing the +3
- to be consistent. NEXT TIME COMMENT STRANGE THINGS LIKE THAT! :-)*/
+ to be consistent. NEXT TIME COMMENT STRANGE THINGS LIKE THAT! :-)
+
+ Update: I think I now know why. The kernel reserves 3kb for process \
information. + */
ps->vmRss = ps->vmRss * sysconf(_SC_PAGESIZE) / 1024; /*convert to KiB*/
ps->vmSize /= 1024; /* convert to KiB */
@@ -454,6 +457,7 @@
removeCommand( "kill" );
removeCommand( "setpriority" );
}
+ closeDir( procDir );
exitPWUIDCache();
}
--- trunk/KDE/kdebase/workspace/ksysguard/ksysguardd/Linux/acpi.c #1015598:1015599
@@ -101,6 +101,7 @@
AcpiBatteryCharge[ AcpiBatteryNum ] = 0;
AcpiBatteryNum++;
}
+ closedir( d );
}
}
@@ -284,6 +285,7 @@
registerMonitor(th_ref, "integer", printThermalZoneTemperature,
printThermalZoneTemperatureInfo, sm);
}
+ closedir( d );
return;
}
@@ -380,6 +382,7 @@
registerMonitor(th_ref, "integer", printFanState,
printFanStateInfo, sm);
}
+ closedir( d );
return;
}
--- trunk/KDE/kdebase/workspace/ksysguard/ksysguardd/Linux/logfile.c #1015598:1015599
@@ -123,6 +123,7 @@
if ( ( entry = (LogFileEntry*)malloc( sizeof( LogFileEntry ) ) ) == NULL ) {
print_error( "malloc()" );
output( "0\n" );
+ fclose(file);
return;
}
--- trunk/KDE/kdebase/workspace/ksysguard/ksysguardd/Linux/stat.c #1015598:1015599
@@ -598,6 +598,7 @@
registerMonitor( "cpu/context", "float", printCtxt, printCtxtInfo, StatSM );
}
}
+ fclose(stat);
stat = fopen("/proc/vmstat", "r");
if(!stat) {
@@ -618,7 +619,7 @@
registerMonitor( "cpu/pageOut", "float", printPageOut, printPageOutInfo, StatSM \
); }
}
-
+ fclose(stat);
if ( CPUCount > 0 )
SMPLoad = (CPULoadInfo*)calloc( CPUCount, sizeof( CPULoadInfo ) );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic