summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-04-27 09:27:42 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-04-27 09:27:42 +0200
commitc6e21cfe0bc0185e4db5bf2bb346128059b7126c (patch)
tree07a8d15b30e4521f8c5c38a0a59b8f094c56ccc1
parentc1b6c87c62f544fa6353bdb45bd9a21139eb1fa9 (diff)
downloaduca-c6e21cfe0bc0185e4db5bf2bb346128059b7126c.tar.gz
uca-c6e21cfe0bc0185e4db5bf2bb346128059b7126c.tar.bz2
uca-c6e21cfe0bc0185e4db5bf2bb346128059b7126c.tar.xz
uca-c6e21cfe0bc0185e4db5bf2bb346128059b7126c.zip
Somehow handle errors of IPE camera
-rw-r--r--src/cameras/ipe.c5
1 files changed, 4 insertions, 1 deletions
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);