mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-02 21:30:29 +00:00
Cleanup partition map management
This commit is contained in:
parent
55aa4a8e04
commit
22b712687f
@ -186,22 +186,30 @@ stream_t *stream_open(char *dev)
|
|||||||
|
|
||||||
map = map_open(&stream->device);
|
map = map_open(&stream->device);
|
||||||
if (map == NULL)
|
if (map == NULL)
|
||||||
goto map_error;
|
{
|
||||||
|
stream->device.close(&stream->device);
|
||||||
|
free(stream);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
stream->device.data = map;
|
stream->device.data = map;
|
||||||
ret = map_read(map, partition);
|
ret = map_read(map, partition);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
goto map_read_error;
|
{
|
||||||
stream->device.read_sector = (stream_read_sector_t)map_read_sector;
|
|
||||||
stream->device.close = (stream_close_t)map_close;
|
|
||||||
map_read_error:
|
|
||||||
map_close(map);
|
map_close(map);
|
||||||
map_error:
|
|
||||||
#endif /* MAP_SUPPORT */
|
|
||||||
stream->device.close(&stream->device);
|
stream->device.close(&stream->device);
|
||||||
free(stream);
|
free(stream);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
stream->device.read_sector = (stream_read_sector_t)map_read_sector;
|
||||||
|
stream->device.close = (stream_close_t)map_close;
|
||||||
|
map_close(map);
|
||||||
|
#else
|
||||||
|
stream->device.close(&stream->device);
|
||||||
|
free(stream);
|
||||||
|
return NULL;
|
||||||
|
#endif /* MAP_SUPPORT */
|
||||||
|
}
|
||||||
|
|
||||||
switch(fs)
|
switch(fs)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user