This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-utils.git tree:

Subject: (c)v4l-helpers: fix broken tests for existence of ioctls.
Author:  Hans Verkuil <[email protected]>
Date:    Mon Jul 28 16:15:25 2014 +0200

Instead of checking for success, check for a result != ENOTTY.

Unfortunately this will fail for kernels older than 3.1 when the
default return code for a non-existing ioctl was EINVAL. All I
can say is: upgrade your kernel, there is a reason EINVAL was a
bad idea...

Signed-off-by: Hans Verkuil <[email protected]>

 utils/qv4l2/general-tab.cpp          |    2 +-
 utils/v4l2-compliance/cv4l-helpers.h |    9 ++-------
 utils/v4l2-compliance/v4l-helpers.h  |    8 ++++----
 3 files changed, 7 insertions(+), 12 deletions(-)

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=faaf33fd3b40c81d818c695219fddad31293c05d

diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp
index df926b7..8a2c90e 100644
--- a/utils/qv4l2/general-tab.cpp
+++ b/utils/qv4l2/general-tab.cpp
@@ -328,7 +328,7 @@ void GeneralTab::inputSection(v4l2_input vin)
                m_stdRow->addWidget(m_tvStandard, 0, 1, Qt::AlignLeft);
                connect(m_tvStandard, SIGNAL(activated(int)), 
SLOT(standardChanged(int)));
                refreshStandards();
-               if (ioctl_exists(cv4l_ioctl(VIDIOC_QUERYSTD, &tmp))) {
+               if (query_std(tmp) != ENOTTY) {
                        m_qryStandard = new QToolButton(parentWidget());
                        m_qryStandard->setIcon(QIcon(":/enterbutt.png"));
                        m_stdRow->addWidget(new QLabel("Query Standard", 
parentWidget()), 0, 2, Qt::AlignLeft);
diff --git a/utils/v4l2-compliance/cv4l-helpers.h 
b/utils/v4l2-compliance/cv4l-helpers.h
index d050686..49ab7f7 100644
--- a/utils/v4l2-compliance/cv4l-helpers.h
+++ b/utils/v4l2-compliance/cv4l-helpers.h
@@ -194,11 +194,6 @@ public:
                return cv4l_ioctl(VIDIOC_ENUMAUDOUT, &audout);
        }
 
-       bool ioctl_exists(int ret)
-       {
-               return ret == 0 || errno != ENOTTY;
-       }
-
        bool has_crop()
        {
                v4l2_selection sel;
@@ -206,7 +201,7 @@ public:
                memset(&sel, 0, sizeof(sel));
                sel.type = g_selection_type();
                sel.target = V4L2_SEL_TGT_CROP;
-               return ioctl_exists(g_selection(sel));
+               return g_selection(sel) != ENOTTY;
        }
 
        bool has_compose()
@@ -216,7 +211,7 @@ public:
                memset(&sel, 0, sizeof(sel));
                sel.type = g_selection_type();
                sel.target = V4L2_SEL_TGT_COMPOSE;
-               return ioctl_exists(g_selection(sel));
+               return g_selection(sel) != ENOTTY;
        }
 
        bool cur_io_has_crop()
diff --git a/utils/v4l2-compliance/v4l-helpers.h 
b/utils/v4l2-compliance/v4l-helpers.h
index e9f4176..7e8413b 100644
--- a/utils/v4l2-compliance/v4l-helpers.h
+++ b/utils/v4l2-compliance/v4l-helpers.h
@@ -410,13 +410,13 @@ static inline int v4l_open(struct v4l_fd *f, const char 
*devname, bool non_block
        f->caps = v4l_capability_g_caps(&f->cap);
        f->type = v4l_determine_type(f);
 
-       f->have_query_ext_ctrl = v4l_ioctl(f, VIDIOC_QUERY_EXT_CTRL, &qec) == 0;
-       f->have_ext_ctrls = v4l_ioctl(f, VIDIOC_TRY_EXT_CTRLS, &ec) == 0;
-       f->have_next_ctrl = v4l_ioctl(f, VIDIOC_QUERYCTRL, &qc) == 0;
+       f->have_query_ext_ctrl = v4l_ioctl(f, VIDIOC_QUERY_EXT_CTRL, &qec) != 
ENOTTY;
+       f->have_ext_ctrls = v4l_ioctl(f, VIDIOC_TRY_EXT_CTRLS, &ec) != ENOTTY;
+       f->have_next_ctrl = v4l_ioctl(f, VIDIOC_QUERYCTRL, &qc) != ENOTTY;
        sel.type = v4l_g_selection_type(f);
        sel.target = sel.type == V4L2_BUF_TYPE_VIDEO_CAPTURE ?
                        V4L2_SEL_TGT_CROP : V4L2_SEL_TGT_COMPOSE;
-       f->have_selection = v4l_ioctl(f, VIDIOC_G_SELECTION, &sel) == 0;
+       f->have_selection = v4l_ioctl(f, VIDIOC_G_SELECTION, &sel) != ENOTTY;
 
        return f->fd;
 }

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to