path: root/utils/rds-ctl/rds-ctl.cpp
diff options
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-11-25 10:59:22 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-11-25 10:59:22 +0100
commit6e19bb895a16a9a247524ac526ab47f576cc36f6 (patch)
tree9c4ca63c49efe4f1b6215a8e39c9963a5e428e1f /utils/rds-ctl/rds-ctl.cpp
parent0349bea74d06578b4d1c06533317876985c64ace (diff)
v4l-utils: use v4l_getsubopt instead of getsubopt
Android doesn't have getsubopt at all, and some libc implementations use a getsubopt variant that behaves slightly different. So add a new v4l-getsubopt.h header that either just uses the glibc function (if glibc is detected) or uses a static inline v4l_getsubopt that is copied from glibc. This should avoid such problems. Reported-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/rds-ctl/rds-ctl.cpp')
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp
index 80a9396a..2a17b430 100644
--- a/utils/rds-ctl/rds-ctl.cpp
+++ b/utils/rds-ctl/rds-ctl.cpp
@@ -26,6 +26,7 @@
#include <linux/videodev2.h>
#include <libv4l2rds.h>
+#include <v4l-getsubopt.h>
using dev_vec = std::vector<std::string>;
using dev_map = std::map<std::string, std::string>;
@@ -362,7 +363,7 @@ static dev_vec list_devices()
static int parse_subopt(char **subs, const char * const *subopts, char **value)
- int opt = getsubopt(subs, const_cast<char * const *>(subopts), value);
+ int opt = v4l_getsubopt(subs, const_cast<char * const *>(subopts), value);
if (opt == -1) {
fprintf(stderr, "Invalid suboptions specified\n");

Privacy Policy