2005-11-21 23:55:56 +00:00
|
|
|
/*
|
|
|
|
*
|
2006-09-15 14:55:39 +00:00
|
|
|
* (c) 2005 Laurent Vivier <Laurent@lvivier.info>
|
2005-11-21 23:55:56 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "libstream.h"
|
|
|
|
|
|
|
|
int stream_close(stream_t *stream)
|
|
|
|
{
|
2008-04-20 16:07:24 +00:00
|
|
|
if (stream->fs.close)
|
|
|
|
stream->fs.close(stream->file);
|
2005-11-22 23:12:16 +00:00
|
|
|
if (stream->fs.umount &&
|
2008-04-20 16:07:24 +00:00
|
|
|
stream->fs.umount(stream->volume) != 0)
|
2005-11-21 23:55:56 +00:00
|
|
|
return -1;
|
2008-04-20 16:07:24 +00:00
|
|
|
if (stream->device.close)
|
|
|
|
stream->device.close(stream->device.data);
|
2005-11-21 23:55:56 +00:00
|
|
|
free(stream);
|
|
|
|
return 0;
|
|
|
|
}
|