+ if (!stat_task->pcd)
+ return;
+ client_close(stat_task->pcd);
+ stat_task->pcd = NULL;
+ FOR_EACH_STATUS_ITEM(i) {
+ free(stat_task->stat_item_values[i]);
+ stat_task->stat_item_values[i] = NULL;
+ }
+ dump_empty_status();
+ stat_task->length_seconds = 0;
+ stat_task->offset_seconds = 0;
+ audiod_status_dump();
+ stat_task->playing = 0;
+ stat_task->stat_item_values[SI_BASENAME] = make_message(
+ "%s: no connection to para_server\n",
+ status_item_list[SI_BASENAME]);
+ stat_client_write(stat_task->stat_item_values[SI_BASENAME],
+ SI_BASENAME);
+ if (stat_task->clock_diff_count) {
+ stat_task->clock_diff_barrier.tv_sec = now->tv_sec + 1;
+ stat_task->clock_diff_barrier.tv_usec = now->tv_usec;
+ }
+}
+
+/**
+ * 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);