summaryrefslogtreecommitdiffstats
path: root/linux/Platform.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-02-23 03:34:06 -0300
committerHisham Muhammad <hisham@gobolinux.org>2015-02-23 03:34:06 -0300
commit50000d808e23a80b8e3ec26b46062c419edff6d4 (patch)
treec87415cdc2a4f904fc90f30b7f4822a068addfb6 /linux/Platform.c
parent5ca9b8e00266a4a3513143b91b87a616caee8f1c (diff)
Silence warnings reported in #70.
Diffstat (limited to 'linux/Platform.c')
-rw-r--r--linux/Platform.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/linux/Platform.c b/linux/Platform.c
index 8d3e2976..0d5b2471 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -80,8 +80,9 @@ int Platform_getUptime() {
double uptime = 0;
FILE* fd = fopen(PROCDIR "/uptime", "r");
if (fd) {
- fscanf(fd, "%64lf", &uptime);
+ int n = fscanf(fd, "%64lf", &uptime);
fclose(fd);
+ if (n <= 0) return 0;
}
return (int) floor(uptime);
}
@@ -103,7 +104,7 @@ int Platform_getMaxPid() {
FILE* file = fopen(PROCDIR "/sys/kernel/pid_max", "r");
if (!file) return -1;
int maxPid = 4194303;
- fscanf(file, "%32d", &maxPid);
+ (void) fscanf(file, "%32d", &maxPid);
fclose(file);
return maxPid;
}