Commit a584141c authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

io/Open: add `flags` parameter to OpenReadOnly()

parent 4e88f95f
...@@ -34,10 +34,10 @@ ...@@ -34,10 +34,10 @@
#include <fcntl.h> #include <fcntl.h>
UniqueFileDescriptor UniqueFileDescriptor
OpenReadOnly(const char *path) OpenReadOnly(const char *path, int flags)
{ {
UniqueFileDescriptor fd; UniqueFileDescriptor fd;
if (!fd.OpenReadOnly(path)) if (!fd.Open(path, O_RDONLY|flags))
throw FormatErrno("Failed to open '%s'", path); throw FormatErrno("Failed to open '%s'", path);
return fd; return fd;
......
...@@ -34,7 +34,7 @@ class FileDescriptor; ...@@ -34,7 +34,7 @@ class FileDescriptor;
class UniqueFileDescriptor; class UniqueFileDescriptor;
UniqueFileDescriptor UniqueFileDescriptor
OpenReadOnly(const char *path); OpenReadOnly(const char *path, int flags=0);
UniqueFileDescriptor UniqueFileDescriptor
OpenWriteOnly(const char *path, int flags=0); OpenWriteOnly(const char *path, int flags=0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment