summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch
diff options
context:
space:
mode:
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.patch57
1 files changed, 29 insertions, 28 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
index 6944bb7aa0..5610ed9beb 100644
--- a/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch
+++ b/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch
@@ -1,6 +1,6 @@
1From 33a57979738e5ab13950ec1c0e7298e41ef50929 Mon Sep 17 00:00:00 2001 1From 69171c22f3872ecb4c1ab27985e93ca44084595e Mon Sep 17 00:00:00 2001
2From: Patrick Ohly <patrick.ohly@intel.com> 2From: Fan Xin <fan.xin@jp.fujitsu.com>
3Date: Thu, 23 Feb 2017 18:10:47 +0100 3Date: Mon, 5 Jun 2017 13:26:38 +0900
4Subject: [PATCH] aslfiles.c: manipulate fds instead of FILE 4Subject: [PATCH] aslfiles.c: manipulate fds instead of FILE
5 5
6Copying what stdout/stderr point to is not portable and fails with 6Copying what stdout/stderr point to is not portable and fails with
@@ -12,60 +12,61 @@ writes into. This works on the platforms that Yocto targets.
12Upstream-Status: Inappropriate [embedded specific] 12Upstream-Status: Inappropriate [embedded specific]
13 13
14Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> 14Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
15
16Rebase on acpica 20170303
17
18Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
15--- 19---
16 source/compiler/aslfiles.c | 20 +++++++++++--------- 20 acpica-unix2-20170303/source/compiler/aslfiles.c | 14 +++++++++++---
17 1 file changed, 11 insertions(+), 9 deletions(-) 21 1 file changed, 11 insertions(+), 3 deletions(-)
18 22
19diff --git a/source/compiler/aslfiles.c b/source/compiler/aslfiles.c 23diff --git a/acpica-unix2-20170303/source/compiler/aslfiles.c b/acpica-unix2-20170303/source/compiler/aslfiles.c
20index 947e465..7a352b4 100644 24index 809090c..97898b1 100644
21--- a/source/compiler/aslfiles.c 25--- a/acpica-unix2-20170303/source/compiler/aslfiles.c
22+++ b/source/compiler/aslfiles.c 26+++ b/acpica-unix2-20170303/source/compiler/aslfiles.c
23@@ -44,6 +44,11 @@ 27@@ -44,6 +44,10 @@
24 #include "aslcompiler.h" 28 #include "aslcompiler.h"
25 #include "acapps.h" 29 #include "acapps.h"
26 30 #include "dtcompiler.h"
27+#include <sys/types.h> 31+#include <sys/types.h>
28+#include <sys/stat.h> 32+#include <sys/stat.h>
29+#include <fcntl.h> 33+#include <fcntl.h>
30+#include <unistd.h> 34+#include <unistd.h>
31+ 35
32 #define _COMPONENT ACPI_COMPILER 36 #define _COMPONENT ACPI_COMPILER
33 ACPI_MODULE_NAME ("aslfiles") 37 ACPI_MODULE_NAME ("aslfiles")
34 38@@ -607,6 +611,8 @@ FlOpenMiscOutputFiles (
35@@ -569,6 +574,8 @@ FlOpenMiscOutputFiles (
36 39
37 if (Gbl_DebugFlag) 40 if (Gbl_DebugFlag)
38 { 41 {
39+ int fd; 42+ int fd;
40+ 43+
41 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG); 44 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG);
42 if (!Filename) 45 if (!Filename)
43 { 46 {
44@@ -582,20 +589,15 @@ FlOpenMiscOutputFiles ( 47@@ -618,10 +624,10 @@ FlOpenMiscOutputFiles (
45 /* TBD: hide this behind a FlReopenFile function */ 48 /* Open the debug file as STDERR, text mode */
46 49
47 Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename; 50 Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename;
48- Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = 51- Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle =
49- freopen (Filename, "w+t", stderr); 52- freopen (Filename, "w+t", stderr);
50- 53
51- if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle) 54- if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle)
52+ fd = open(Filename, O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); 55+ fd = open(Filename, O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
53+ if (fd < 0 || 56+ if (fd < 0 ||
54+ dup2(fd, fileno(stderr))) 57+ dup2(fd, fileno(stderr)))
55 { 58 {
56- /* 59 /*
57- * A problem with freopen is that on error, 60 * A problem with freopen is that on error, we no longer
58- * we no longer have stderr. 61@@ -635,6 +641,8 @@ FlOpenMiscOutputFiles (
59- */ 62 exit (1);
60 Gbl_DebugFlag = FALSE;
61- memcpy (stderr, stdout, sizeof (FILE));
62 FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME);
63 AslAbort ();
64 } 63 }
65+ Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = stderr;
66 64
65+ Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = stderr;
66+
67 AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); 67 AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
68 AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT); 68 AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT);
69 }
69-- 70--
702.1.4 711.9.1
71 72