]> code.ossystems Code Review - openembedded-core.git/blob
6fe86ff3f081a987a9a5543d730bfe107cd01494
[openembedded-core.git] /
1 From 58760e09eed662a72da939ff4802d605489cff8e Mon Sep 17 00:00:00 2001
2 From: Denys Dmytriyenko <denys@ti.com>
3 Date: Tue, 8 Sep 2020 19:37:42 -0400
4 Subject: [PATCH] tests: include fcntl.h for open(), O_RDWR, O_CLOEXEC and
5  O_CREAT
6
7 musl libc (unlike glibc) requires explicitly incuding fcntl.h to define open(),
8 O_RDWR, O_CLOEXEC and O_CREAT. Otherwise the build fails with the errors:
9
10 | ../weston-9.0.0/tests/weston-test-fixture-compositor.c: In function 'wait_for_lock':
11 | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:7: warning: implicit declaration of function 'open'; did you mean 'popen'? [-Wimplicit-function-declaration]
12 |   135 |  fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
13 |       |       ^~~~
14 |       |       popen
15 | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: error: 'O_RDWR' undeclared (first use in this function)
16 |   135 |  fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
17 |       |                       ^~~~~~
18 | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: note: each undeclared identifier is reported only once for each function it appears in
19 | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:32: error: 'O_CLOEXEC' undeclared (first use in this function)
20 |   135 |  fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
21 |       |                                ^~~~~~~~~
22 | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:44: error: 'O_CREAT' undeclared (first use in this function)
23 |   135 |  fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
24 |       |                                            ^~~~~~~
25
26 Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/493/diffs?commit_id=b10c0e843dcb8148bbe869bb15261955b94ac98c]
27
28 Signed-off-by: Denys Dmytriyenko <denys@ti.com>
29 ---
30  tests/weston-test-fixture-compositor.c | 1 +
31  1 file changed, 1 insertion(+)
32
33 diff --git a/tests/weston-test-fixture-compositor.c b/tests/weston-test-fixture-compositor.c
34 index 0c9855f..e0e32c9 100644
35 --- a/tests/weston-test-fixture-compositor.c
36 +++ b/tests/weston-test-fixture-compositor.c
37 @@ -31,6 +31,7 @@
38  #include <unistd.h>
39  #include <sys/file.h>
40  #include <errno.h>
41 +#include <fcntl.h>
42  
43  #include "shared/helpers.h"
44  #include "weston-test-fixture-compositor.h"
45 -- 
46 2.7.4
47