X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2F__fdopen.c;h=a6ae73a2021306dfd461ef86592977c90f14cada;hb=dd5f50da6f6c3df5647e922e47f8568a8896a752;hp=a2ca62b1f20b0080c835f91cd3c426357576e574;hpb=3af2edee150484940916eba1984f78c3b965dd05;p=musl diff --git a/src/stdio/__fdopen.c b/src/stdio/__fdopen.c index a2ca62b1..a6ae73a2 100644 --- a/src/stdio/__fdopen.c +++ b/src/stdio/__fdopen.c @@ -32,7 +32,8 @@ FILE *__fdopen(int fd, const char *mode) /* Set append mode on fd if opened for append */ if (*mode == 'a') { int flags = __syscall(SYS_fcntl, fd, F_GETFL); - __syscall(SYS_fcntl, fd, F_SETFL, flags | O_APPEND); + if (!(flags & O_APPEND)) + __syscall(SYS_fcntl, fd, F_SETFL, flags | O_APPEND); f->flags |= F_APP; }