error message
This commit is contained in:
parent
d8d9dddece
commit
a2ba845992
|
|
@ -265,7 +265,14 @@ static void set_static_system_info(void)
|
||||||
|
|
||||||
system_info.osName = TMALLOC(char, size + 1);
|
system_info.osName = TMALLOC(char, size + 1);
|
||||||
rewind(file);
|
rewind(file);
|
||||||
fread(system_info.osName, sizeof(char), size, file);
|
if (fread(system_info.osName, sizeof(char), size, file) != size) {
|
||||||
|
(void) fprintf(cp_err, "Unable to read \"/proc/version\".\n");
|
||||||
|
fclose(file);
|
||||||
|
tfree(system_info.osName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
||||||
system_info.osName[size] = '\0';
|
system_info.osName[size] = '\0';
|
||||||
|
|
@ -287,7 +294,12 @@ static void set_static_system_info(void)
|
||||||
/* get complete string */
|
/* get complete string */
|
||||||
inStr = TMALLOC(char, size+1);
|
inStr = TMALLOC(char, size+1);
|
||||||
rewind(file);
|
rewind(file);
|
||||||
fread(inStr, sizeof(char), size, file);
|
if (fread(inStr, sizeof(char), size, file) != size) {
|
||||||
|
(void) fprintf(cp_err, "Unable to read \"/proc/cpuinfo\".\n");
|
||||||
|
fclose(file);
|
||||||
|
txfree(inStr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
inStr[size] = '\0';
|
inStr[size] = '\0';
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -377,7 +389,7 @@ static void set_static_system_info(void)
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
tfree(inStr);
|
txfree(inStr);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
} /* end of case that file was opened OK */
|
} /* end of case that file was opened OK */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue