From debdd776106ed687075abdfebfd6c3e61f1179e2 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 30 Dec 2014 18:37:04 +1100 Subject: [PATCH] io: add O_CREAT to flags with ACCESS_WRITE --- io.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io.cpp b/io.cpp index a025ce94..5f551591 100644 --- a/io.cpp +++ b/io.cpp @@ -43,11 +43,11 @@ access_to_cflags (access_t a) { int flags = 0; if ((a & ACCESS_READWRITE) == ACCESS_READWRITE) { - flags = O_RDWR; + flags = O_RDWR | O_CREAT; } else if (a & ACCESS_READ) { flags = O_RDONLY; } else if (a & ACCESS_WRITE) { - flags = O_WRONLY; + flags = O_WRONLY | O_CREAT; } a = static_cast (a & ~ACCESS_READWRITE);