diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-07-14 18:55:35 -0700 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2017-07-24 18:57:37 +0200 |
commit | 0f55207ad2be1ce6cd3577afa6d1ce869665743b (patch) | |
tree | 50fa5920f227db4863ca35618340261ee7221b91 /meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-v4l2-ctl-Do-not-use-getsubopt.patch | |
parent | 85d4fe73352886b4d22a77d8ab5163d267d21fa2 (diff) | |
download | meta-openembedded-0f55207ad2be1ce6cd3577afa6d1ce869665743b.tar.gz |
v4l-utils: Fix build with musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-v4l2-ctl-Do-not-use-getsubopt.patch')
-rw-r--r-- | meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-v4l2-ctl-Do-not-use-getsubopt.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-v4l2-ctl-Do-not-use-getsubopt.patch b/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-v4l2-ctl-Do-not-use-getsubopt.patch new file mode 100644 index 000000000..0a986ae5d --- /dev/null +++ b/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-v4l2-ctl-Do-not-use-getsubopt.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From d04aa6866cbea57c4a81b033cd60586a9436ac6b Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 14 Jul 2017 13:20:05 -0700 | ||
4 | Subject: [PATCH 3/3] v4l2-ctl: Do not use getsubopt | ||
5 | |||
6 | POSIX says that behavior when subopts list is empty is undefined. | ||
7 | musl libs will set value to NULL which leads to crash. | ||
8 | |||
9 | Taken from AlpineLinux | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | utils/v4l2-ctl/v4l2-ctl-common.cpp | 19 ++++++++++--------- | ||
14 | 1 file changed, 10 insertions(+), 9 deletions(-) | ||
15 | |||
16 | diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp | ||
17 | index 3ea6cd3..291fb3e 100644 | ||
18 | --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp | ||
19 | +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp | ||
20 | @@ -692,16 +692,17 @@ static bool parse_subset(char *optarg) | ||
21 | |||
22 | static bool parse_next_subopt(char **subs, char **value) | ||
23 | { | ||
24 | - static char *const subopts[] = { | ||
25 | - NULL | ||
26 | - }; | ||
27 | - int opt = getsubopt(subs, subopts, value); | ||
28 | + char *p = *subs; | ||
29 | + *value = *subs; | ||
30 | |||
31 | - if (opt < 0 || *value) | ||
32 | - return false; | ||
33 | - fprintf(stderr, "No value given to suboption <%s>\n", | ||
34 | - subopts[opt]); | ||
35 | - return true; | ||
36 | + while (*p && *p != ',') | ||
37 | + p++; | ||
38 | + | ||
39 | + if (*p) | ||
40 | + *p++ = '\0'; | ||
41 | + | ||
42 | + *subs = p; | ||
43 | + return false; | ||
44 | } | ||
45 | |||
46 | void common_cmd(int ch, char *optarg) | ||
47 | -- | ||
48 | 2.13.3 | ||
49 | |||