From: Andre Noll Date: Sat, 20 Jul 2013 10:28:18 +0000 (+0200) Subject: audiod: Fix error message on status errors. X-Git-Tag: v0.5.1~11^2~11 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=c967924027fa0b94ebe2c6b28bc191578f7afaea;ds=sidebyside audiod: Fix error message on status errors. If para_audiod can not parse a status item received from para_server, it currently prints task_notify: notifying task client: audiod switched off btr_remove_node: removing btr node client from buffer tree unregister_task: unregistering client (audiod switched off) This is misleading at best. The error message for status timeouts has the same problem. This patch makes para_audiod print meaningful error messages in both cases. --- diff --git a/audiod.c b/audiod.c index 611e72d7..64925b76 100644 --- a/audiod.c +++ b/audiod.c @@ -1223,14 +1223,14 @@ static int status_post_select(struct sched *s, struct task *t) struct timeval diff; tv_diff(now, &st->last_status_read, &diff); if (diff.tv_sec > 61) - task_notify(&st->ct->task, E_AUDIOD_OFF); + task_notify(&st->ct->task, E_STATUS_TIMEOUT); goto out; } btr_merge(st->btrn, st->min_iqs); sz = btr_next_buffer(st->btrn, &buf); ret = for_each_stat_item(buf, sz, update_item); if (ret < 0) { - task_notify(&st->ct->task, E_AUDIOD_OFF); + task_notify(&st->ct->task, -ret); goto out; } if (sz != ret) { diff --git a/error.h b/error.h index b0133dee..82df5ca9 100644 --- a/error.h +++ b/error.h @@ -338,6 +338,7 @@ extern const char **para_errlist[]; PARA_ERROR(UNSUPPORTED_AUDIO_FORMAT, "given audio format not supported"), \ PARA_ERROR(NOT_PLAYING, "not playing"), \ PARA_ERROR(AUDIOD_OFF, "audiod switched off"), \ + PARA_ERROR(STATUS_TIMEOUT, "status item timeout"), \ #define AUDIOD_COMMAND_ERRORS \