From acc8d39288bdd4c27308d748b5af1b52949bfd0b Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Fri, 27 Jul 2012 14:55:15 +0200 Subject: Output errors from pcilib --- src/cameras/uca-ufo-camera.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cameras/uca-ufo-camera.c b/src/cameras/uca-ufo-camera.c index 09704af..66d2f6d 100644 --- a/src/cameras/uca-ufo-camera.c +++ b/src/cameras/uca-ufo-camera.c @@ -98,8 +98,16 @@ struct _UcaUfoCameraPrivate { guint bit_mode; }; -static void ignore_messages(const char *format, ...) +static void +error_handler (const char *format, ...) { + va_list args; + gchar *message; + + va_start (args, format); + message = g_strdup_vprintf (format, args); + g_warning ("%s", message); + va_end (args); } static guint @@ -145,7 +153,7 @@ UcaUfoCamera *uca_ufo_camera_new(GError **error) return NULL; } - pcilib_set_error_handler(&ignore_messages, &ignore_messages); + pcilib_set_error_handler(&error_handler, &error_handler); /* Generate properties from model description */ model_description = pcilib_get_model_description(handle); -- cgit v1.2.3