Build warning:
sys-utils/hwclock-cmos.c: In function 'is_in_cpuinfo':
sys-utils/hwclock-cmos.c:162:4: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
fgets(field, 256, cpuinfo);
Full build log:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.26.2-9&stamp=
1440078034
Detected by/via:
https://qa.debian.org/bls/packages/u/util-linux.html
This change has never actually been (build-)tested on alpha, but
hopefully the change should fix the warning.
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
sprintf(format, "%s : %s", fmt, "%255s");
- if ((cpuinfo = fopen("/proc/cpuinfo", "r")) != NULL) {
- while (!feof(cpuinfo)) {
+ cpuinfo = fopen("/proc/cpuinfo", "r");
+ if (cpuinfo) {
+ do {
if (fscanf(cpuinfo, format, field) == 1) {
if (strncmp(field, str, strlen(str)) == 0)
found = 1;
break;
}
- fgets(field, 256, cpuinfo);
- }
+ } while (fgets(field, 256, cpuinfo));
fclose(cpuinfo);
}
return found;