From 37b28d57897f50cccfbc47cddc41058e1f3334eb Mon Sep 17 00:00:00 2001 From: Max Wash Date: Fri, 7 Aug 2020 16:40:57 +0100 Subject: [PATCH] Fixed fopen() not using correct flags for mx_file_open() --- photon/libc/sys/magenta/fio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/photon/libc/sys/magenta/fio.c b/photon/libc/sys/magenta/fio.c index d6c8efb..d66df45 100644 --- a/photon/libc/sys/magenta/fio.c +++ b/photon/libc/sys/magenta/fio.c @@ -51,7 +51,8 @@ void __fio_init(mx_handle_t in, mx_handle_t out, mx_handle_t err) int __fio_fopen(const char *path, const char *mode, struct __io_file *fp) { mx_handle_t h = MX_NULL_HANDLE; - mx_status_t stat = mx_file_open(MX_NULL_HANDLE, path, 0, &h); + mx_flags_t flags = flags_from_mode(mode); + mx_status_t stat = mx_file_open(MX_NULL_HANDLE, path, flags, &h); if (stat != MX_OK) { return -1;