libfstools/rootdisk.c: In function 'rootdisk_volume_identify':
libfstools/rootdisk.c:172:7: error: ignoring return value of 'fread', declared with attribute warn_unused_result [-Werror=unused-result]
fread(&magic, sizeof(magic), 1, f);
^
libfstools/rootdisk.c:179:7: error: ignoring return value of 'fread', declared with attribute warn_unused_result [-Werror=unused-result]
fread(&magic, sizeof(magic), 1, f);
^
libfstools/rootdisk.c: In function 'rootdisk_volume_init':
libfstools/rootdisk.c:268:9: error: ignoring return value of 'system', declared with attribute warn_unused_result [-Werror=unused-result]
system(str);
^
cc1: all warnings being treated as errors
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
struct rootdev_volume *p = container_of(v, struct rootdev_volume, v);
int ret = FS_NONE;
uint32_t magic = 0;
struct rootdev_volume *p = container_of(v, struct rootdev_volume, v);
int ret = FS_NONE;
uint32_t magic = 0;
FILE *f;
f = fopen(rootdev, "r");
FILE *f;
f = fopen(rootdev, "r");
return ret;
fseeko(f, p->offset + 0x400, SEEK_SET);
return ret;
fseeko(f, p->offset + 0x400, SEEK_SET);
- fread(&magic, sizeof(magic), 1, f);
+ n = fread(&magic, sizeof(magic), 1, f);
+ if (n != 1)
+ return -1;
if (magic == cpu_to_le32(0xF2F52010))
ret = FS_F2FS;
magic = 0;
fseeko(f, p->offset + 0x438, SEEK_SET);
if (magic == cpu_to_le32(0xF2F52010))
ret = FS_F2FS;
magic = 0;
fseeko(f, p->offset + 0x438, SEEK_SET);
- fread(&magic, sizeof(magic), 1, f);
+ n = fread(&magic, sizeof(magic), 1, f);
+ if (n != 1)
+ return -1;
if ((le32_to_cpu(magic) & 0xffff) == 0xef53)
ret = FS_EXT4;
if ((le32_to_cpu(magic) & 0xffff) == 0xef53)
ret = FS_EXT4;
{
struct rootdev_volume *p = container_of(v, struct rootdev_volume, v);
char str[128];
{
struct rootdev_volume *p = container_of(v, struct rootdev_volume, v);
char str[128];
if (!p->loop_name[0] && rootdisk_create_loop(p) != 0)
return -1;
if (!p->loop_name[0] && rootdisk_create_loop(p) != 0)
return -1;
snprintf(str, sizeof(str), "mkfs.f2fs -l rootfs_data %s", v->blk);
else
snprintf(str, sizeof(str), "mkfs.ext4 -L rootfs_data %s", v->blk);
snprintf(str, sizeof(str), "mkfs.f2fs -l rootfs_data %s", v->blk);
else
snprintf(str, sizeof(str), "mkfs.ext4 -L rootfs_data %s", v->blk);
}
static struct driver rootdisk_driver = {
}
static struct driver rootdisk_driver = {