From: Andre Noll Date: Mon, 18 Jan 2010 09:52:32 +0000 (+0100) Subject: Don't use ENAVAIL. X-Git-Tag: v0.4.2~79 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=59df964251d4e6b71b4ce6d02fdbb6e11643acab;hp=e1cf532cb70722ae80f2364ff1d7cfbf126f4caf Don't use ENAVAIL. NetBSD doesn't know it, and the error text does not fit well. So replace it by a paraslash error message. --- diff --git a/aacdec_filter.c b/aacdec_filter.c index 9809552c..d48b18e0 100644 --- a/aacdec_filter.c +++ b/aacdec_filter.c @@ -62,13 +62,13 @@ static int aacdec_execute(struct btr_node *btrn, const char *cmd, char **result) if (!strcmp(cmd, "samplerate")) { if (padd->samplerate == 0) - return -ERRNO_TO_PARA_ERROR(ENAVAIL); + return -E_BTR_NAVAIL; *result = make_message("%u", padd->samplerate); return 1; } if (!strcmp(cmd, "channels")) { if (padd->channels == 0) - return -ERRNO_TO_PARA_ERROR(ENAVAIL); + return -E_BTR_NAVAIL; *result = make_message("%u", padd->channels); return 1; } diff --git a/error.h b/error.h index 5a5d015d..ecea044b 100644 --- a/error.h +++ b/error.h @@ -40,6 +40,7 @@ extern const char **para_errlist[]; #define BUFFER_TREE_ERRORS \ PARA_ERROR(BTR_EOF, "buffer tree: end of file"), \ PARA_ERROR(BTR_NO_CHILD, "btr node has no children"), \ + PARA_ERROR(BTR_NAVAIL, "btr node: value currently unavailable"), \ #define STDOUT_ERRORS \ PARA_ERROR(STDOUT_EOF, "stdout: end of file"), \ diff --git a/mp3dec_filter.c b/mp3dec_filter.c index 696367d6..a025eed5 100644 --- a/mp3dec_filter.c +++ b/mp3dec_filter.c @@ -232,13 +232,13 @@ static int mp3dec_execute(struct btr_node *btrn, const char *cmd, char **result) if (!strcmp(cmd, "samplerate")) { if (pmd->samplerate == 0) - return -ERRNO_TO_PARA_ERROR(ENAVAIL); + return -E_BTR_NAVAIL; *result = make_message("%u", pmd->samplerate); return 1; } if (!strcmp(cmd, "channels")) { if (pmd->channels == 0) - return -ERRNO_TO_PARA_ERROR(ENAVAIL); + return -E_BTR_NAVAIL; *result = make_message("%u", pmd->channels); return 1; } diff --git a/oggdec_filter.c b/oggdec_filter.c index bac28cfd..f14d97c1 100644 --- a/oggdec_filter.c +++ b/oggdec_filter.c @@ -125,13 +125,13 @@ static int oggdec_execute(struct btr_node *btrn, const char *cmd, char **result) if (!strcmp(cmd, "samplerate")) { if (pod->samplerate == 0) - return -ERRNO_TO_PARA_ERROR(ENAVAIL); + return -E_BTR_NAVAIL; *result = make_message("%u", pod->samplerate); return 1; } if (!strcmp(cmd, "channels")) { if (pod->channels == 0) - return -ERRNO_TO_PARA_ERROR(ENAVAIL); + return -E_BTR_NAVAIL; *result = make_message("%u", pod->channels); return 1; } diff --git a/wmadec_filter.c b/wmadec_filter.c index 12339962..d78c72bd 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -1210,13 +1210,13 @@ static int wmadec_execute(struct btr_node *btrn, const char *cmd, char **result) if (!strcmp(cmd, "samplerate")) { if (pwd->ahi.sample_rate == 0) - return -ERRNO_TO_PARA_ERROR(ENAVAIL); + return -E_BTR_NAVAIL; *result = make_message("%u", pwd->ahi.sample_rate); return 1; } if (!strcmp(cmd, "channels")) { if (pwd->ahi.channels == 0) - return -ERRNO_TO_PARA_ERROR(ENAVAIL); + return -E_BTR_NAVAIL; *result = make_message("%u", pwd->ahi.channels); return 1; } diff --git a/write.c b/write.c index d8863359..bf178c47 100644 --- a/write.c +++ b/write.c @@ -74,13 +74,13 @@ static int check_wav_exec(struct btr_node *btrn, const char *cmd, char **result) if (!strcmp(cmd, "samplerate")) { if (cwt->state != CWS_HAVE_HEADER) - return -ERRNO_TO_PARA_ERROR(ENAVAIL); + return -E_BTR_NAVAIL; *result = make_message("%d", cwt->samplerate); return 1; } if (!strcmp(cmd, "channels")) { if (cwt->state != CWS_HAVE_HEADER) - return -ERRNO_TO_PARA_ERROR(ENAVAIL); + return -E_BTR_NAVAIL; *result = make_message("%d", cwt->channels); return 1; }