Add a check for libosl to configure.ac.
[paraslash.git] / audioc.c
index aa7184e09070d4742650cc7b72904ab066ebc482..666990dba411e65b4dfff4d4d227332e7401ac92 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2007 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2009 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -21,7 +21,8 @@ INIT_AUDIOC_ERRLISTS;
 /** the gengetopt structure containing command line args */
 struct audioc_args_info conf;
 
-INIT_STDERR_LOGGING(conf.loglevel_arg);
+static int loglevel;
+INIT_STDERR_LOGGING(loglevel);
 
 static char *concat_args(unsigned argc, char * const *argv)
 {
@@ -87,6 +88,7 @@ int main(int argc, char *argv[])
                        exit(EXIT_FAILURE);
                }
        }
+       loglevel = get_loglevel_by_name(conf.loglevel_arg);
        args = conf.inputs_num?
                concat_args(conf.inputs_num, conf.inputs) :
                para_strdup("stat");
@@ -106,7 +108,12 @@ int main(int argc, char *argv[])
        if (ret < 0)
                goto out;
        fd = ret;
-
+       ret = mark_fd_nonblocking(fd);
+       if (ret < 0)
+               goto out;
+       ret = mark_fd_nonblocking(STDOUT_FILENO);
+       if (ret < 0)
+               goto out;
        ret = send_cred_buffer(fd, args);
        if (ret < 0)
                goto out;
@@ -150,6 +157,6 @@ out:
        if (!ret && loaded && buf)
                ret = write(STDOUT_FILENO, buf, loaded);
        if (ret < 0)
-               PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret));
+               PARA_ERROR_LOG("%s\n", para_strerror(-ret));
        return ret < 0? EXIT_FAILURE : EXIT_SUCCESS;
 }