mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zpcictl: Fix compile warning
zpcictl.c: In function ‘sysfs_read_value’: zpcictl.c:154:2: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result] fscanf(fp, "%x", &val); ^~~~~~~~~~~~~~~~~~~~~~ Reviewed-by: Stefan Haberland <sth@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -151,7 +151,12 @@ static unsigned int sysfs_read_value(struct zpci_device *pdev, const char *attr)
|
||||
fp = fopen(path, "r");
|
||||
if (!fp)
|
||||
fopen_err(path);
|
||||
fscanf(fp, "%x", &val);
|
||||
if (fscanf(fp, "%x", &val) != 1) {
|
||||
fclose(fp);
|
||||
warnx("Could not read file %s: %s", path, strerror(errno));
|
||||
free(path);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fclose(fp);
|
||||
free(path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user