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
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:
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);
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);
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);
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);
26 Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/493/diffs?commit_id=b10c0e843dcb8148bbe869bb15261955b94ac98c]
28 Signed-off-by: Denys Dmytriyenko <denys@ti.com>
30 tests/weston-test-fixture-compositor.c | 1 +
31 1 file changed, 1 insertion(+)
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
43 #include "shared/helpers.h"
44 #include "weston-test-fixture-compositor.h"