From a584141cae42f6c2c4e601fa79e0e8fa5fc25e4b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 30 Apr 2020 21:30:57 +0200 Subject: [PATCH] io/Open: add `flags` parameter to OpenReadOnly() --- src/io/Open.cxx | 4 ++-- src/io/Open.hxx | 2 +- 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 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);