write: Remove ->shutdown.
[paraslash.git] / oss_write.c
index e79ea6ced6c62f3fdfe1b6ce59cf7f7784cb9614..eae4167a18503b2cc8014a5069b53ce8c8eb9677 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2009-2012 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -9,9 +9,7 @@
 #include <regex.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
-#include <dirent.h>
 #include <sys/soundcard.h>
-#include <stdbool.h>
 
 #include "para.h"
 #include "fd.h"
@@ -154,6 +152,8 @@ err:
        close(powd->fd);
 err_free:
        free(powd);
+       PARA_ERROR_LOG("failed to init %s: %s\n", conf->device_arg,
+               para_strerror(-ret));
        return ret;
 }
 
@@ -191,7 +191,7 @@ static void oss_post_select(__a_unused struct sched *s,
        ret = 0;
        if (!FD_ISSET(powd->fd, &s->wfds))
                goto out;
-       ret = write_nonblock(powd->fd, data, frames * powd->bytes_per_frame);
+       ret = xwrite(powd->fd, data, frames * powd->bytes_per_frame);
        if (ret < 0)
                goto out;
        btr_consume(btrn, ret);
@@ -233,7 +233,6 @@ void oss_write_init(struct writer *w)
        w->post_select = oss_post_select;
        w->parse_config_or_die = oss_parse_config_or_die;
        w->free_config = oss_free_config;
-       w->shutdown = NULL;
        w->help = (struct ggo_help) {
                .short_help = oss_write_args_info_help,
                .detailed_help = oss_write_args_info_detailed_help