audiod_status_dump();
}
-/**
- * close the connection to para_server and exit
- *
- * \param status the exit status which is passed to exit(3)
- * \param msg the log message
- *
- * Log \a msg with loglevel \p EMERG, close the connection to para_server if
- * open, and call \p exit(status). \a status should be either EXIT_SUCCESS or
- * EXIT_FAILURE.
- *
- * \sa exit(3)
- */
-void __noreturn clean_exit(int status, const char *msg)
-{
- PARA_EMERG_LOG("%s\n", msg);
- if (socket_name)
- unlink(socket_name);
- close_stat_pipe();
- exit(status);
-}
-
/* avoid busy loop if server is down */
static void set_stat_task_restart_barrier(unsigned seconds)
{
return true;
}
+static void close_slot(int slot_num)
+{
+ struct slot_info *s = slot + slot_num;
+
+ PARA_INFO_LOG("closing slot %d\n", slot_num);
+ close_writers(s);
+ close_filters(s);
+ close_receiver(slot_num);
+ clear_slot(slot_num);
+}
+
static void close_unused_slots(void)
{
int i;
- FOR_EACH_SLOT(i) {
- struct slot_info *s = slot + i;
- if (!must_close_slot(i))
- continue;
- PARA_INFO_LOG("closing slot %d\n", i);
- close_writers(s);
- close_filters(s);
- close_receiver(i);
- clear_slot(i);
- }
+ FOR_EACH_SLOT(i)
+ if (must_close_slot(i))
+ close_slot(i);
+}
+
+/**
+ * Close the connection to para_server and exit.
+ *
+ * \param status The exit status which is passed to exit(3).
+ * \param msg The log message
+ *
+ * Log \a msg with loglevel \p EMERG, close the connection to para_server and
+ * all slots, and call \p exit(status). \a status should be either EXIT_SUCCESS
+ * or EXIT_FAILURE.
+ *
+ * \sa exit(3).
+ */
+void __noreturn clean_exit(int status, const char *msg)
+{
+ int i;
+
+ PARA_EMERG_LOG("%s\n", msg);
+ if (socket_name)
+ unlink(socket_name);
+ close_stat_pipe();
+ FOR_EACH_SLOT(i)
+ close_slot(i);
+ exit(status);
}
/*