Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 1 | Ubuntu defaults to passing _FORTIFY_SOURCE=2 which breaks byacc as it doesn't |
| 2 | pass enough arguments to open(): |
| 3 | |
| 4 | inlined from 'open_tmpfile' at byacc-20150711/main.c:588:5: |
| 5 | /usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error: |
| 6 | open with O_CREAT in second argument needs 3 arguments |
| 7 | |
| 8 | Add a mode of 0666 to fix this. |
| 9 | |
| 10 | Upstream-Status: Pending |
| 11 | Signed-off-by: Ross Burton <ross.burton@intel.com> |
| 12 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 13 | diff --git a/main.c b/main.c |
| 14 | index 620ce3f..82071a4 100644 |
| 15 | --- a/main.c |
| 16 | +++ b/main.c |
| 17 | @@ -526,7 +526,7 @@ my_mkstemp(char *temp) |
| 18 | } |
| 19 | if ((name = tempnam(dname, fname)) != 0) |
| 20 | { |
| 21 | - fd = open(name, O_CREAT | O_EXCL | O_RDWR); |
| 22 | + fd = open(name, O_CREAT | O_EXCL | O_RDWR, 0666); |
| 23 | strcpy(temp, name); |
| 24 | } |
| 25 | else |