wmifs: Use result of fgets.
Remove several compiler warnings of the form wmifs.c:666:7: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] fgets(temp, BUFFER_SIZE, fp); ^
This commit is contained in:
parent
5db612b7c9
commit
3b4c28b9bc
1 changed files with 16 additions and 4 deletions
|
@ -664,8 +664,14 @@ int get_statistics(char *devname, long *ip, long *op, long *is, long *os)
|
||||||
|
|
||||||
/* Read from /proc/net/dev the stats! */
|
/* Read from /proc/net/dev the stats! */
|
||||||
fp = fopen("/proc/net/dev", "r");
|
fp = fopen("/proc/net/dev", "r");
|
||||||
fgets(temp, BUFFER_SIZE, fp);
|
if (!fgets(temp, BUFFER_SIZE, fp)) {
|
||||||
fgets(temp, BUFFER_SIZE, fp);
|
fclose(fp);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (!fgets(temp, BUFFER_SIZE, fp)) {
|
||||||
|
fclose(fp);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
input = -1;
|
input = -1;
|
||||||
output = -1;
|
output = -1;
|
||||||
|
@ -757,8 +763,14 @@ int checknetdevs(void)
|
||||||
fd = fopen("/proc/net/dev", "r");
|
fd = fopen("/proc/net/dev", "r");
|
||||||
if (fd) {
|
if (fd) {
|
||||||
/* Skip the first 2 lines */
|
/* Skip the first 2 lines */
|
||||||
fgets(temp, BUFFER_SIZE, fd);
|
if (!fgets(temp, BUFFER_SIZE, fd)) {
|
||||||
fgets(temp, BUFFER_SIZE, fd);
|
fclose(fd);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (!fgets(temp, BUFFER_SIZE, fd)) {
|
||||||
|
fclose(fd);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
while (fgets(temp, BUFFER_SIZE, fd)) {
|
while (fgets(temp, BUFFER_SIZE, fd)) {
|
||||||
p = strtok(temp, tokens);
|
p = strtok(temp, tokens);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
|
|
Loading…
Reference in a new issue