scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 20db0c15edc7ca8bcc31188036be04fd64379a18
parent fce016bf1b5fd8ebccfe0cbf93cd492458a1fb9a
Author: Quentin Rameau <quinq@fifth.space>
Date:   Fri,  8 May 2020 10:34:06 +0200

libc: Fix fopen default file mode

The Linux syscall takes a third argument for file mode opening.

Diffstat:
Msrc/libc/stdio/_fpopen.c | 2+-
Msrc/libc/syscall.h | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libc/stdio/_fpopen.c b/src/libc/stdio/_fpopen.c @@ -53,7 +53,7 @@ _fpopen(const char * restrict fname, return NULL; } - if ((fd = _open(fname, flags)) < 0) + if ((fd = _open(fname, flags, 0666)) < 0) return NULL; fp->buf = NULL; diff --git a/src/libc/syscall.h b/src/libc/syscall.h @@ -1,5 +1,5 @@ extern void *_brk(void *addr); -extern int _open(const char *path, int flags); +extern int _open(const char *path, int flags, int mode); extern int _close(int fd); extern int _read(int fd, void *buf, size_t n); extern int _write(int fd, void *buf, size_t n);