diff options
Diffstat (limited to 'meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch')
-rw-r--r-- | meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch b/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch deleted file mode 100644 index d8b5f9aa8a..0000000000 --- a/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | From 540d80469e6a7dce6baf7214df90e86daffc5175 Mon Sep 17 00:00:00 2001 | ||
2 | From: Fan Xin <fan.xin@jp.fujitsu.com> | ||
3 | Date: Mon, 5 Jun 2017 13:26:38 +0900 | ||
4 | Subject: [PATCH] aslfiles.c: manipulate fds instead of FILE | ||
5 | |||
6 | Copying what stdout/stderr point to is not portable and fails with | ||
7 | musl because FILE is an undefined struct. | ||
8 | |||
9 | Instead, use lower-level Unix functions to modify the file that stderr | ||
10 | writes into. This works on the platforms that Yocto targets. | ||
11 | |||
12 | Upstream-Status: Inappropriate [embedded specific] | ||
13 | |||
14 | Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> | ||
15 | |||
16 | Rebase on acpica 20170303 | ||
17 | |||
18 | Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com> | ||
19 | |||
20 | --- | ||
21 | source/compiler/aslfiles.c | 15 ++++++++++++--- | ||
22 | 1 file changed, 12 insertions(+), 3 deletions(-) | ||
23 | |||
24 | diff --git a/source/compiler/aslfiles.c b/source/compiler/aslfiles.c | ||
25 | index 82865db..cc072dc 100644 | ||
26 | --- a/source/compiler/aslfiles.c | ||
27 | +++ b/source/compiler/aslfiles.c | ||
28 | @@ -43,6 +43,11 @@ | ||
29 | |||
30 | #include "aslcompiler.h" | ||
31 | #include "acapps.h" | ||
32 | +#include "dtcompiler.h" | ||
33 | +#include <sys/types.h> | ||
34 | +#include <sys/stat.h> | ||
35 | +#include <fcntl.h> | ||
36 | +#include <unistd.h> | ||
37 | |||
38 | #define _COMPONENT ACPI_COMPILER | ||
39 | ACPI_MODULE_NAME ("aslfiles") | ||
40 | @@ -606,6 +611,8 @@ FlOpenMiscOutputFiles ( | ||
41 | |||
42 | if (Gbl_DebugFlag) | ||
43 | { | ||
44 | + int fd; | ||
45 | + | ||
46 | Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG); | ||
47 | if (!Filename) | ||
48 | { | ||
49 | @@ -617,10 +624,10 @@ FlOpenMiscOutputFiles ( | ||
50 | /* Open the debug file as STDERR, text mode */ | ||
51 | |||
52 | Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename; | ||
53 | - Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = | ||
54 | - freopen (Filename, "w+t", stderr); | ||
55 | |||
56 | - if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle) | ||
57 | + fd = open(Filename, O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); | ||
58 | + if (fd < 0 || | ||
59 | + dup2(fd, fileno(stderr))) | ||
60 | { | ||
61 | /* | ||
62 | * A problem with freopen is that on error, we no longer | ||
63 | @@ -634,6 +641,8 @@ FlOpenMiscOutputFiles ( | ||
64 | exit (1); | ||
65 | } | ||
66 | |||
67 | + Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = stderr; | ||
68 | + | ||
69 | AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); | ||
70 | AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT); | ||
71 | } | ||