mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
file: destroy IO in file_destroy() instead of file_stop()
This commit is contained in:
parent
9868f97ab5
commit
8b18bd35e0
1 changed files with 15 additions and 4 deletions
|
@ -250,21 +250,31 @@ int file_start(struct node *n)
|
|||
|
||||
int file_stop(struct node *n)
|
||||
{
|
||||
struct file *f = (struct file *) n->_vd;
|
||||
int ret;
|
||||
struct file *f = (struct file *) n->_vd;
|
||||
|
||||
task_destroy(&f->task);
|
||||
ret = task_destroy(&f->task);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = io_close(&f->io);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
free(f->uri);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int file_destroy(struct node *n)
|
||||
{
|
||||
int ret;
|
||||
struct file *f = (struct file *) n->_vd;
|
||||
|
||||
ret = io_destroy(&f->io);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
free(f->uri);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -371,6 +381,7 @@ static struct plugin p = {
|
|||
.print = file_print,
|
||||
.start = file_start,
|
||||
.stop = file_stop,
|
||||
.destroy = file_destroy,
|
||||
.read = file_read,
|
||||
.write = file_write,
|
||||
.fd = file_fd
|
||||
|
|
Loading…
Add table
Reference in a new issue