Minor change

This commit is contained in:
6arelyFuture 2021-06-03 09:48:00 +02:00
parent 851c3e5976
commit 1f94af91d3
Signed by: Future
GPG Key ID: FA77F074E98D98A5

View File

@ -13,6 +13,12 @@ FILE *popen(const char *command, const char *mode);
int pclose(FILE *stream); int pclose(FILE *stream);
char *strerror(int errnum); char *strerror(int errnum);
void printGenericStatusError()
{
printf("Error while parsing file\n");
printf("Processes may not be correctly monitored\n");
}
void checkStatus(FILE *file, int *currRealMem, int *peakRealMem, void checkStatus(FILE *file, int *currRealMem, int *peakRealMem,
int *currVirtMem, int *peakVirtMem) int *currVirtMem, int *peakVirtMem)
{ {
@ -26,7 +32,7 @@ void checkStatus(FILE *file, int *currRealMem, int *peakRealMem,
{ {
if (fscanf(file, " %d", currRealMem) == EOF) if (fscanf(file, " %d", currRealMem) == EOF)
{ {
printf("Error while parsing file\n"); printGenericStatusError();
return; return;
} }
} }
@ -35,7 +41,7 @@ void checkStatus(FILE *file, int *currRealMem, int *peakRealMem,
{ {
if (fscanf(file, " %d", peakRealMem) == EOF) if (fscanf(file, " %d", peakRealMem) == EOF)
{ {
printf("Error while parsing file\n"); printGenericStatusError();
return; return;
} }
} }
@ -44,7 +50,7 @@ void checkStatus(FILE *file, int *currRealMem, int *peakRealMem,
{ {
if (fscanf(file, " %d", currVirtMem) == EOF) if (fscanf(file, " %d", currVirtMem) == EOF)
{ {
printf("Error while parsing file\n"); printGenericStatusError();
return; return;
} }
} }
@ -53,7 +59,7 @@ void checkStatus(FILE *file, int *currRealMem, int *peakRealMem,
{ {
if (fscanf(file, " %d", peakVirtMem) == EOF) if (fscanf(file, " %d", peakVirtMem) == EOF)
{ {
printf("Error while parsing file\n"); printGenericStatusError();
return; return;
} }
} }