summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-io
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-12-18 11:15:27 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-12-18 11:15:27 +0900
commit5e22e8e3509a4c2422befed01b29949097c903ed (patch)
tree18e7059ba66750ae9602778ae4ec69e16d468e0a /mrbgems/mruby-io
parentb4dcb8f2863274314d202baafc7f1f64b5a4cc7f (diff)
downloadmruby-5e22e8e3509a4c2422befed01b29949097c903ed.tar.gz
mruby-5e22e8e3509a4c2422befed01b29949097c903ed.zip
`open` on Windows takes `int` 3rd argument instead of `mode_t`.
Diffstat (limited to 'mrbgems/mruby-io')
-rw-r--r--mrbgems/mruby-io/src/io.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mrbgems/mruby-io/src/io.c b/mrbgems/mruby-io/src/io.c
index 0abb9014a..f17407ff6 100644
--- a/mrbgems/mruby-io/src/io.c
+++ b/mrbgems/mruby-io/src/io.c
@@ -34,12 +34,15 @@
typedef int fsize_t;
typedef long ftime_t;
typedef long fsuseconds_t;
+ typedef int fmode_t;
+
#else
#include <sys/wait.h>
#include <unistd.h>
typedef size_t fsize_t;
typedef time_t ftime_t;
typedef suseconds_t fsuseconds_t;
+ typedef mode_t fmode_t;
#endif
#ifdef _MSC_VER
@@ -740,7 +743,7 @@ mrb_cloexec_open(mrb_state *mrb, const char *pathname, mrb_int flags, mrb_int mo
flags |= O_NOINHERIT;
#endif
reopen:
- fd = open(fname, (int)flags, mode);
+ fd = open(fname, (int)flags, (fmode_t)mode);
if (fd == -1) {
if (!retry) {
switch (errno) {