local: Fix compile warning: declared with attribute warn_unused_result
This commit is contained in:
1 parent
848e3fe06c
commit
a1febdd2ea
1 file changed
+4
-2
+4
-2
@@ -294,7 +294,8 @@ int local_dump_image(enum image_type image, const char * file) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
read(fd, buf, sizeof(buf));
|
if ( read(fd, buf, sizeof(buf)) < 0 )
|
||||||
|
buf[0] = 0;
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
if ( strncmp(buf, "internal", strlen("internal")) != 0 )
|
if ( strncmp(buf, "internal", strlen("internal")) != 0 )
|
||||||
@@ -413,7 +414,8 @@ int local_dump_image(enum image_type image, const char * file) {
|
|||||||
unlink(file);
|
unlink(file);
|
||||||
} else if ( nlen != len ) {
|
} else if ( nlen != len ) {
|
||||||
printf("Truncating file %s to %d bytes...\n", file, (int)nlen);
|
printf("Truncating file %s to %d bytes...\n", file, (int)nlen);
|
||||||
ftruncate(fd, nlen);
|
if ( ftruncate(fd, nlen) < 0 )
|
||||||
|
ERROR_INFO("Cannot truncate file %s", file);
|
||||||
}
|
}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
Reference in new issue
Block a user