mirror of
https://github.com/vivier/EMILE.git
synced 2024-09-08 04:54:25 +00:00
Check function is defined before using it
This commit is contained in:
parent
e046538add
commit
8d736d79fe
@ -10,11 +10,14 @@
|
||||
|
||||
int stream_close(stream_t *stream)
|
||||
{
|
||||
if (stream->fs.close(stream->fs.file) != 0)
|
||||
if (stream->fs.close &&
|
||||
stream->fs.close(stream->fs.file) != 0)
|
||||
return -1;
|
||||
if (stream->fs.umount(stream->fs.volume) != 0)
|
||||
if (stream->fs.umount &&
|
||||
stream->fs.umount(stream->fs.volume) != 0)
|
||||
return -1;
|
||||
if (stream->device.close(stream->device.data) != 0)
|
||||
if (stream->device.close &&
|
||||
stream->device.close(stream->device.data) != 0)
|
||||
return -1;
|
||||
free(stream);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user