refactor: Add InitContext function to initialize NodeContext with global pointers

Having InitContext() avoids the need to add duplicate code to src/init/*.cpp
files in the next commit. It also lets these files avoid referencing global
variables like gArgs.

There is no change in behavior in this commit.
This commit is contained in:
Ryan Ofsky
2023-07-07 17:32:54 -04:00
parent feeb7b816a
commit 213542b625
6 changed files with 15 additions and 8 deletions

View File

@@ -192,6 +192,10 @@ static void RemovePidFile(const ArgsManager& args)
}
}
void InitContext(NodeContext& node)
{
node.args = &gArgs;
}
//////////////////////////////////////////////////////////////////////////////
//