summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2015-05-15 11:33:25 +0200
committerChristian Hesse <mail@eworm.de>2015-05-15 11:33:25 +0200
commit08829cbc3b5682809333aa005b0bc669760c895a (patch)
tree8a040c1d96855af99b117f6dbafe82568f744dac /linux
parentf4f6d54ffd820243862c6189176a3159d2ebd7a6 (diff)
fix compiler warnings
gcc gives warnings like this: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result Assign value to a variable, cast to (void) to discard it.
Diffstat (limited to 'linux')
-rw-r--r--linux/LinuxProcessList.c3
-rw-r--r--linux/Platform.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index 926bebbc..e4bc8e50 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -94,7 +94,8 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui
int cpus = -1;
do {
cpus++;
- fgets(buffer, 255, file);
+ char * s = fgets(buffer, 255, file);
+ (void) s;
} while (String_startsWith(buffer, "cpu"));
fclose(file);
diff --git a/linux/Platform.c b/linux/Platform.c
index f14c38c7..fad0e6b7 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -110,7 +110,8 @@ int Platform_getMaxPid() {
FILE* file = fopen(PROCDIR "/sys/kernel/pid_max", "r");
if (!file) return -1;
int maxPid = 4194303;
- (void) fscanf(file, "%32d", &maxPid);
+ int match = fscanf(file, "%32d", &maxPid);
+ (void) match;
fclose(file);
return maxPid;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy