From 94bfe39ec6e74646fc989007bdae3138a2ec5325 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 1 Nov 2018 23:35:52 -0700 Subject: [PATCH] ircd::fs: Save the std openmode in the fd::opts struct. --- include/ircd/fs/fd.h | 3 +++ ircd/fs.cc | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/ircd/fs/fd.h b/include/ircd/fs/fd.h index 84a4fd919..43817d60b 100644 --- a/include/ircd/fs/fd.h +++ b/include/ircd/fs/fd.h @@ -45,6 +45,9 @@ struct ircd::fs::fd struct ircd::fs::fd::opts { + /// std openmode passed from ctor. + std::ios::openmode mode {std::ios::openmode(0)}; + /// open(2) flags. Usually generated from ios::open_mode ctor. ulong flags {0}; diff --git a/ircd/fs.cc b/ircd/fs.cc index 7f9177c79..629844da9 100644 --- a/ircd/fs.cc +++ b/ircd/fs.cc @@ -652,7 +652,11 @@ ircd::fs::path_str(const string_view &s) // ircd::fs::fd::opts::opts(const std::ios::openmode &mode) -:flags +:mode +{ + mode +} +,flags { posix_flags(mode) }