From c6e21cfe0bc0185e4db5bf2bb346128059b7126c Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 27 Apr 2011 09:27:42 +0200 Subject: Somehow handle errors of IPE camera --- src/cameras/ipe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cameras/ipe.c b/src/cameras/ipe.c index a2fa6f6..1f46867 100644 --- a/src/cameras/ipe.c +++ b/src/cameras/ipe.c @@ -112,8 +112,11 @@ static uint32_t uca_ipe_destroy(struct uca_camera_priv *cam) uint32_t uca_ipe_init(struct uca_camera_priv **cam, struct uca_grabber_priv *grabber) { pcilib_model_t model = PCILIB_MODEL_DETECT; + pcilib_set_error_handler(uca_ipe_handle_error, uca_ipe_handle_error); pcilib_t *handle = pcilib_open("/dev/fpga0", model); - if (handle < 0) + /* XXX: This is not working because pcilib is still returning a valid + * structure although things like "failing ioctl's" can happen. */ + if (handle == NULL) return UCA_ERR_CAMERA | UCA_ERR_INIT | UCA_ERR_NOT_FOUND; pcilib_set_error_handler(&uca_ipe_handle_error, &uca_ipe_handle_error); -- cgit v1.2.3