2005-11-21 23:55:56 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* (c) 2005 Laurent Vivier <LaurentVivier@wanadoo.fr>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "libstream.h"
|
|
|
|
|
|
|
|
int stream_close(stream_t *stream)
|
|
|
|
{
|
2005-11-22 23:12:16 +00:00
|
|
|
if (stream->fs.close &&
|
|
|
|
stream->fs.close(stream->fs.file) != 0)
|
2005-11-21 23:55:56 +00:00
|
|
|
return -1;
|
2005-11-22 23:12:16 +00:00
|
|
|
if (stream->fs.umount &&
|
|
|
|
stream->fs.umount(stream->fs.volume) != 0)
|
2005-11-21 23:55:56 +00:00
|
|
|
return -1;
|
2005-11-22 23:12:16 +00:00
|
|
|
if (stream->device.close &&
|
|
|
|
stream->device.close(stream->device.data) != 0)
|
2005-11-21 23:55:56 +00:00
|
|
|
return -1;
|
|
|
|
free(stream);
|
|
|
|
return 0;
|
|
|
|
}
|