summaryrefslogtreecommitdiff
path: root/v4l2-apps/lib
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-12-20 12:42:37 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-20 12:42:37 -0200
commit43315dd15292f6e2b75eefed38c75fb14fa12745 (patch)
tree631c886ed7b58bc6e5f5ea6003ed5c3b6504eab6 /v4l2-apps/lib
parent5ede70524cd7f9bb21a82802fe67538defa04727 (diff)
downloadmediapointer-dvb-s2-43315dd15292f6e2b75eefed38c75fb14fa12745.tar.gz
mediapointer-dvb-s2-43315dd15292f6e2b75eefed38c75fb14fa12745.tar.bz2
Improved error handling at driver-test.c
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l2-apps/lib')
-rw-r--r--v4l2-apps/lib/v4l2_driver.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/v4l2-apps/lib/v4l2_driver.c b/v4l2-apps/lib/v4l2_driver.c
index 69c873abb..24ed2846b 100644
--- a/v4l2-apps/lib/v4l2_driver.c
+++ b/v4l2-apps/lib/v4l2_driver.c
@@ -170,12 +170,11 @@ int v4l2_open (char *device, int debug, struct v4l2_driver *drv)
drv->debug=debug;
if ((drv->fd = open(device, O_RDWR )) < 0) {
- perror("Couldn't open video0");
- return(errno);
+ return(-errno);
}
ret=xioctl(drv->fd,VIDIOC_QUERYCAP,(void *) &drv->cap);
- if (ret>=0 && drv->debug) {
+ if (!ret && drv->debug) {
printf ("driver=%s, card=%s, bus=%s, version=%d.%d.%d, "
"capabilities=%s\n",
drv->cap.driver,drv->cap.card,drv->cap.bus_info,