From 59df964251d4e6b71b4ce6d02fdbb6e11643acab Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 18 Jan 2010 10:52:32 +0100 Subject: [PATCH 1/1] 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. --- aacdec_filter.c | 4 ++-- error.h | 1 + mp3dec_filter.c | 4 ++-- oggdec_filter.c | 4 ++-- wmadec_filter.c | 4 ++-- write.c | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) 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; } -- 2.39.2