fwtool.c:216:3: error: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Werror=unused-result]
fwtool.c:376:3: error: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Werror=unused-result]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
if (ret) {
fflush(firmware_file);
- ftruncate(fileno(firmware_file), file_len);
+ ret = ftruncate(fileno(firmware_file), file_len);
+ if (ret < 0)
+ msg("Error during ftruncate: %m\n");
}
return ret;
}
}
- if (!ret && truncate_file)
- ftruncate(fileno(firmware_file), dbuf.file_len);
+ if (!ret && truncate_file) {
+ ret = ftruncate(fileno(firmware_file), dbuf.file_len);
+ if (ret < 0) {
+ msg("Error during ftruncate: %m\n");
+ goto out;
+ }
+ }
if (write_truncated) {
if (dbuf.prev)