Skip to content

Commit

Permalink
If plugin script disappears while fppd is running (example: plugin un…
Browse files Browse the repository at this point in the history
…installed) don't polute logs with stack traces
  • Loading branch information
dkulp committed Dec 20, 2024
1 parent fab1a90 commit 502ffc3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class ScriptCommand : public Command {
for (auto a : sargs) {
LogErr(VB_PLUGIN, " %s\n", a);
}
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
} else {
LogExcess(VB_PLUGIN, "Command parent process, resuming work.\n");
waitpid(pid, nullptr, 0);
Expand Down Expand Up @@ -436,7 +436,7 @@ FPPPlugins::Plugin* PluginManager::loadUserPlugin(const std::string& name) {
execl(eventScript.c_str(), "eventScript", filename.c_str(), "--list", NULL);

LogErr(VB_PLUGIN, "We failed to exec our callbacks query! %s %s %s --list\n", eventScript.c_str(), "eventScript", filename.c_str());
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
} else {
close(output_pipe[1]);

Expand Down Expand Up @@ -646,7 +646,7 @@ void MediaCallback::run(const Json::Value& playlist, const MediaDetails& mediaDe
execl(eventScript.c_str(), "eventScript", mFilename.c_str(), "--type", "media", "--data", pluginData.c_str(), NULL);

LogErr(VB_PLUGIN, "We failed to exec our media callback!\n");
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
} else {
LogExcess(VB_PLUGIN, "Media parent process, resuming work.\n");
wait(NULL);
Expand Down Expand Up @@ -676,7 +676,7 @@ void PlaylistCallback::run(const Json::Value& playlist, const std::string& actio
execl(eventScript.c_str(), "eventScript", mFilename.c_str(), "--type", "playlist", "--data", pluginData.c_str(), NULL);

LogErr(VB_PLUGIN, "We failed to exec our playlist callback!\n");
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
} else {
LogExcess(VB_PLUGIN, "Playlist parent process, resuming work.\n");
wait(NULL);
Expand All @@ -697,7 +697,7 @@ void LifecycleCallback::run(const std::string& lifecycle) {
execl(eventScript.c_str(), "eventScript", mFilename.c_str(), "--type", "lifecycle", lifecycle.c_str(), NULL);

LogErr(VB_PLUGIN, "We failed to exec our lifecycle callback!\n");
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
} else {
LogExcess(VB_PLUGIN, "Lifecycle parent process, resuming work.\n");
wait(NULL);
Expand Down

0 comments on commit 502ffc3

Please sign in to comment.