diff options
| author | 2026-05-12 13:51:41 +0100 | |
|---|---|---|
| committer | 2026-05-13 17:19:50 +0100 | |
| commit | 03fb11eab92fa2d36edac7a5cc600953cfed3b4a (patch) | |
| tree | 00c86068f0f19db25652e4e64c54d504f216d0e6 /src/configparser.cpp | |
| parent | Remove sys/stat.h from the global socket header. (diff) | |
Move FilePtr to the pointer utility header.
Diffstat (limited to 'src/configparser.cpp')
| -rw-r--r-- | src/configparser.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index 16d23295a..4644fbe6c 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -68,14 +68,14 @@ struct Parser final { ParseStack& stack; int flags; - FilePtr file; + insp::file_ptr file; FilePosition current; FilePosition last_tag; std::shared_ptr<ConfigTag> tag; int ungot = -1; std::string mandatory_tag; - Parser(ParseStack& me, int myflags, FilePtr conf, const std::string& name, const std::string& mandatorytag) + Parser(ParseStack& me, int myflags, insp::file_ptr conf, const std::string& name, const std::string& mandatorytag) : stack(me) , flags(myflags) , file(std::move(conf)) @@ -443,12 +443,12 @@ void ParseStack::DoInclude(const std::shared_ptr<ConfigTag>& tag, int flags) } } -FilePtr ParseStack::DoOpenFile(const std::string& name, bool isexec) +insp::file_ptr ParseStack::DoOpenFile(const std::string& name, bool isexec) { if (isexec) { ServerInstance->Logs.Debug("CONFIG", "Opening executable: {}", name); - return FilePtr(popen(name.c_str(), "r"), pclose); + return insp::file_ptr(popen(name.c_str(), "r"), pclose); } const std::string path = ServerInstance->Config->Paths.PrependConfig(name); @@ -469,7 +469,7 @@ FilePtr ParseStack::DoOpenFile(const std::string& name, bool isexec) } } #endif - return FilePtr(fopen(path.c_str(), "r"), fclose); + return insp::file_ptr(fopen(path.c_str(), "r"), fclose); } void ParseStack::DoReadFile(const std::string& key, const std::string& name, int flags, bool exec) @@ -533,7 +533,7 @@ bool ParseStack::ParseFile(const std::string& path, int flags, const std::string /* It's not already included, add it to the list of files we've loaded */ - FilePtr file = DoOpenFile(path, isexec); + insp::file_ptr file = DoOpenFile(path, isexec); if (!file) { if (flags & FLAG_MISSING_OKAY) |
