Browse Source

corrected for LINUX

pre-master-46
h_vogt 17 years ago
parent
commit
59665ba2e9
  1. 16
      src/frontend/com_sysinfo.c

16
src/frontend/com_sysinfo.c

@ -40,6 +40,7 @@
#define TesError int #define TesError int
#define TES_FAIL 1 #define TES_FAIL 1
#define TES_SUCCESS 0 #define TES_SUCCESS 0
#define TES_INVALID_PARAMS 1
/* system info */ /* system info */
typedef struct TSI { typedef struct TSI {
@ -208,15 +209,8 @@ tInt searchInSet(const tInt *set, tInt size, tInt match) {
return 0; return 0;
} }
TESAPI void TESAPIENTRY tesFreeSystemInfo(TesSystemInfo *info) {
if(info != NULL) {
free(info->cpuModelName);
free(info->osName);
}
}
/* Get system information */ /* Get system information */
TESAPI TesError TESAPIENTRY tesCreateSystemInfo(TesSystemInfo *info) {
TesError tesCreateSystemInfo(TesSystemInfo *info) {
FILE *file; FILE *file;
TesError error = TES_SUCCESS; TesError error = TES_SUCCESS;
@ -347,17 +341,17 @@ TESAPI TesError TESAPIENTRY tesCreateSystemInfo(TesSystemInfo *info) {
} }
/* another test to get number of logical processors */ /* another test to get number of logical processors */
if {info->numLogicalProcessors == 0) {
if (info->numLogicalProcessors == 0) {
char* token; char* token;
char* cpustr = copy(inStr); char* cpustr = copy(inStr);
while (cpustr) while (cpustr)
if cieq(gettok(&cpustr), "processor") {
if (cieq(gettok(&cpustr), "processor")) {
gettok(&cpustr); gettok(&cpustr);
token = gettok(&cpustr); token = gettok(&cpustr);
} }
info->numLogicalProcessors = atoi(token) + 1; info->numLogicalProcessors = atoi(token) + 1;
tfree cpustr;
tfree(cpustr);
} }
free(inStr); free(inStr);

Loading…
Cancel
Save