Another attempt at fixing storage_*_warnings. Correct return values also.
Change-Id: Ie04da59739f2ce31d5b777157b1214c921aa5615
This commit is contained in:
parent
38050f46af
commit
7dd65f7d9b
1 changed files with 6 additions and 3 deletions
|
@ -192,7 +192,7 @@ int storage_write_sectors(IF_MV2(int drive,)
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int storage_read_sectors(IF_MV2(int drive,)
|
int storage_read_sectors(IF_MV2(int drive,)
|
||||||
|
@ -202,6 +202,7 @@ int storage_read_sectors(IF_MV2(int drive,)
|
||||||
{
|
{
|
||||||
IF_MV((void)drive;)
|
IF_MV((void)drive;)
|
||||||
int i;
|
int i;
|
||||||
|
size_t ret;
|
||||||
|
|
||||||
for (i=0; i<count; i++ ) {
|
for (i=0; i<count; i++ ) {
|
||||||
FILE* f;
|
FILE* f;
|
||||||
|
@ -211,11 +212,13 @@ int storage_read_sectors(IF_MV2(int drive,)
|
||||||
sprintf(name,"sector%lX.bin",start+i);
|
sprintf(name,"sector%lX.bin",start+i);
|
||||||
f=fopen(name,"rb");
|
f=fopen(name,"rb");
|
||||||
if (f) {
|
if (f) {
|
||||||
(void)fread(buf,512,1,f);
|
ret = fread(buf,512,1,f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
if (ret != 512)
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void storage_spin(void)
|
void storage_spin(void)
|
||||||
|
|
Loading…
Reference in a new issue