/*
- * Copyright (C) 2009 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2009-2010 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
int bytes_per_frame;
};
-static void oss_pre_select_btr(struct sched *s, struct task *t)
+static void oss_pre_select(struct sched *s, struct task *t)
{
struct writer_node *wn = container_of(t, struct writer_node, task);
struct private_oss_write_data *powd = wn->private_data;
{
struct private_oss_write_data *powd = wn->private_data;
- close(powd->fd);
+ if (powd->fd >= 0)
+ close(powd->fd);
free(powd);
}
return 1;
err:
close(powd->fd);
- free(powd);
+ powd->fd = -1;
return ret;
}
-static void oss_post_select_btr(__a_unused struct sched *s,
+static void oss_post_select(__a_unused struct sched *s,
struct task *t)
{
struct writer_node *wn = container_of(t, struct writer_node, task);
oss_cmdline_parser_init(&dummy);
w->open = oss_open;
w->close = oss_close;
- w->pre_select_btr = oss_pre_select_btr;
- w->post_select_btr = oss_post_select_btr;
+ w->pre_select = oss_pre_select;
+ w->post_select = oss_post_select;
w->parse_config = oss_parse_config;
w->free_config = oss_free_config;
w->shutdown = NULL;