chiark / gitweb /
libtests: Include the Unicode test files directly.
[disorder] / server / background.c
index be5a3099916629af28a26ed23ef1dba4bfef4deb..8c07361c289b367b449d8c63aba57550a409e73a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of DisOrder.
- * Copyright (C) 2004-2009 Richard Kettlewell
+ * Copyright (C) 2004-2009, 2011 Richard Kettlewell
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,7 +21,8 @@
 
 #include "disorder-server.h"
 
-/** @brief Fork the player or decoder for @p q 
+/** @brief Fork the player or decoder for @p q
+ * @param ev Event loop
  * @param player Pointer to player information
  * @param q Track to play or decode
  * @param child Function to run inside fork
@@ -49,7 +50,7 @@ int play_background(ev_source *ev,
    * modules use this so it's not well tested, unfortunately. */
   if(q->type & DISORDER_PLAYER_PREFORK)
     if(!(q->data = play_prefork(q->pl, q->track))) {
-      error(0, "prefork function for %s failed", q->track);
+      disorder_error(0, "prefork function for %s failed", q->track);
       return START_HARDFAIL;
     }
   /* Capture the player/decoder's stderr and feed it into our logs.
@@ -69,19 +70,9 @@ int play_background(ev_source *ev,
       --optc;
       break;
     }
-    if(!strcmp(optv[0], "--wait-for-device")
-       || !strncmp(optv[0], "--wait-for-device=", 18)) {
-      const char *waitdevice;
-      if((waitdevice = strchr(optv[0], '='))) {
-       params->waitdevice = waitdevice + 1;
-      } else
-        params->waitdevice = "";       /* use default */
-      ++optv;
-      --optc;
-    } else {
-      error(0, "unknown option %s", optv[0]);
-      return START_HARDFAIL;
-    }
+    /* Currently no options supported */
+    disorder_error(0, "unknown option %s", optv[0]);
+    return START_HARDFAIL;
   }
   params->argc = optc;
   params->argv = optv;
@@ -104,7 +95,7 @@ int play_background(ev_source *ev,
     _exit(child(q, params, bgdata));
   case -1:
     /* Back in disorderd (child could not be created) */
-    error(errno, "error calling fork");
+    disorder_error(errno, "error calling fork");
     if(q->type & DISORDER_PLAYER_PREFORK)
       play_cleanup(q->pl, q->data);    /* else would leak */
     if(lfd != -1)