byacc: fix compilation on Ubuntu 14.04

Ubuntu defaults to passing _FORTIFY_SOURCE=2 which breaks byacc as it doesn't
pass enough arguments to open():

inlined from 'open_tmpfile' at byacc-20150711/main.c:588:5:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error:
open with O_CREAT in second argument needs 3 arguments

Add a mode of 0666 to fix this.

(From OE-Core rev: f906c5eb722de07eb09858fd058eb7e20103df71)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton 2015-08-26 21:32:45 +01:00 committed by Richard Purdie
parent 6874f5e72f
commit f9f1643ead
2 changed files with 16 additions and 1 deletions

View File

@ -5,7 +5,9 @@ programming language."
SECTION = "devel"
LICENSE = "PD"
SRC_URI = "ftp://invisible-island.net/byacc/byacc-${PV}.tgz"
SRC_URI = "ftp://invisible-island.net/byacc/byacc-${PV}.tgz \
file://byacc-open.patch"
EXTRA_OECONF += "--program-transform-name='s,^,b,'"
BBCLASSEXTEND = "native"

View File

@ -0,0 +1,13 @@
diff --git a/main.c b/main.c
index 620ce3f..82071a4 100644
--- a/main.c
+++ b/main.c
@@ -526,7 +526,7 @@ my_mkstemp(char *temp)
}
if ((name = tempnam(dname, fname)) != 0)
{
- fd = open(name, O_CREAT | O_EXCL | O_RDWR);
+ fd = open(name, O_CREAT | O_EXCL | O_RDWR, 0666);
strcpy(temp, name);
}
else