From 69a69ade1f952bf5e66ced0de362faa128c0f5a4 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sat, 25 Nov 2000 16:38:04 +0000 Subject: [PATCH] Added the error handler ignoring misleading warnings... --- seq/aconnect/aconnect.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/seq/aconnect/aconnect.c b/seq/aconnect/aconnect.c index 0d3e328..a02f43f 100644 --- a/seq/aconnect/aconnect.c +++ b/seq/aconnect/aconnect.c @@ -22,9 +22,25 @@ #include #include #include +#include #include #include +static void error_handler(const char *file, int line, const char *function, int err, const char *fmt, ...) +{ + va_list arg; + + if (err == ENOENT) /* Ignore those misleading "warnings" */ + return; + va_start(arg, fmt); + fprintf(stderr, "ALSA lib %s:%i:(%s) ", file, line, function); + vfprintf(stderr, fmt, arg); + if (err) + fprintf(stderr, ": %s", snd_strerror(err)); + putc('\n', stderr); + va_end(arg); +} + static void usage(void) { fprintf(stderr, "aconnect - ALSA sequencer connection manager\n"); @@ -335,6 +351,8 @@ int main(int argc, char **argv) return 1; } + snd_lib_error_set_handler(error_handler); + switch (command) { case LIST_INPUT: list_ports(seq, group, SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, list_subs);