projects
/
mes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c349f6f
)
mescc: Support binutils-2.30: fopen fix.
author
Jan Nieuwenhuizen
<janneke@gnu.org>
Sun, 10 Jun 2018 11:33:30 +0000
(13:33 +0200)
committer
Jan Nieuwenhuizen
<janneke@gnu.org>
Sun, 10 Jun 2018 11:33:30 +0000
(13:33 +0200)
* lib/libc+tcc.c (fopen): Set O_APPEND for 'a'.
lib/libc+tcc.c
patch
|
blob
|
history
diff --git
a/lib/libc+tcc.c
b/lib/libc+tcc.c
index 8355f2368674c54619e2b11e2783b1937cd2a6e7..3e41df3013be7f904c409f9973dbdcc015ba53dc 100644
(file)
--- a/
lib/libc+tcc.c
+++ b/
lib/libc+tcc.c
@@
-210,9
+210,10
@@
fopen (char const *file_name, char const *opentype)
if ((opentype[0] == 'a' || !strcmp (opentype, "r+"))
&& !access (file_name, O_RDONLY))
{
-
fd = open (file_name, O_RDWR, mode)
;
+
int flags = O_RDWR
;
if (opentype[0] == 'a')
- lseek (fd, 0, SEEK_END);
+ flags |= O_APPEND;
+ fd = open (file_name, flags, mode);
}
else if (opentype[0] == 'w' || opentype[0] == 'a' || !strcmp (opentype, "r+"))
{