Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable specifying directories in plugin-files. #1862

Merged
merged 1 commit into from Feb 13, 2018

Conversation

shlevy
Copy link
Member

@shlevy shlevy commented Feb 13, 2018

No description provided.

@shlevy shlevy requested a review from edolstra February 13, 2018 12:53
try {
auto ents = readDirectory(pluginFile);
for (auto & ent : ents)
pluginFiles.emplace_back(pluginFile + std::move(ent.name));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this move actually accomplish anything? Isn't it a const argument to + anyway?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Erm, right, this was from before I remembered the ent was relative. Will fix.

void *handle =
dlopen(file.c_str(), RTLD_LAZY | RTLD_LOCAL);
if (!handle)
throw Error(format("could not dynamically open plugin file '%1%': %2%") % file % dlerror());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that nowadays you can write

throw Error("could not dynamically open plugin file '%s': %s", file, dlerror());

@shlevy
Copy link
Member Author

shlevy commented Feb 13, 2018

@edolstra fixed

@edolstra edolstra merged commit 7253113 into NixOS:master Feb 13, 2018
@shlevy shlevy deleted the plugin-dirs branch February 13, 2018 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants