Browse Source

Remove old /tmp/Rack2 symbolic link before creating it.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
8f5f8992fb
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      src/plugin.cpp

+ 4
- 2
src/plugin.cpp View File

@@ -54,9 +54,11 @@ static void* loadLibrary(std::string libraryPath) {
#else #else
// Since Rack 2, plugins on Linux/Mac link to the absolute path /tmp/Rack2/libRack.<ext> // Since Rack 2, plugins on Linux/Mac link to the absolute path /tmp/Rack2/libRack.<ext>
// Create a symlink at /tmp/Rack2 to the system dir containting libRack. // Create a symlink at /tmp/Rack2 to the system dir containting libRack.
std::string systemDir = system::getAbsolute(asset::systemDir);
std::string linkPath = "/tmp/Rack2";
if (!settings::devMode) { if (!settings::devMode) {
std::string systemDir = system::getAbsolute(asset::systemDir);
std::string linkPath = "/tmp/Rack2";
// Clean up old symbolic link in case a different edition was run earlier
system::remove(linkPath);
system::createSymbolicLink(systemDir, linkPath); system::createSymbolicLink(systemDir, linkPath);
} }
// Load library with dlopen // Load library with dlopen


Loading…
Cancel
Save