summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <mk@cm4all.com>2020-04-30 21:30:57 +0200
committerMax Kellermann <max@musicpd.org>2020-12-02 14:52:51 +0100
commita584141cae42f6c2c4e601fa79e0e8fa5fc25e4b (patch)
tree938841396b6ae8597932b630ee98dbad6a0fb0c4
parent4e88f95f94cdf98f14937c5de9d53a3d08a3c93f (diff)
io/Open: add `flags` parameter to OpenReadOnly()
-rw-r--r--src/io/Open.cxx4
-rw-r--r--src/io/Open.hxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/io/Open.cxx b/src/io/Open.cxx
index 1d5bb11f9..79455fe9f 100644
--- a/src/io/Open.cxx
+++ b/src/io/Open.cxx
@@ -34,10 +34,10 @@
#include <fcntl.h>
UniqueFileDescriptor
-OpenReadOnly(const char *path)
+OpenReadOnly(const char *path, int flags)
{
UniqueFileDescriptor fd;
- if (!fd.OpenReadOnly(path))
+ if (!fd.Open(path, O_RDONLY|flags))
throw FormatErrno("Failed to open '%s'", path);
return fd;
diff --git a/src/io/Open.hxx b/src/io/Open.hxx
index 08694a3ed..e2db76203 100644
--- a/src/io/Open.hxx
+++ b/src/io/Open.hxx
@@ -34,7 +34,7 @@ class FileDescriptor;
class UniqueFileDescriptor;
UniqueFileDescriptor
-OpenReadOnly(const char *path);
+OpenReadOnly(const char *path, int flags=0);
UniqueFileDescriptor
OpenWriteOnly(const char *path, int flags=0);