From 879d60c88e24c2c3f2aab9dff73192c901f63f31 Mon Sep 17 00:00:00 2001 From: Andreas Oberritter Date: Thu, 28 Oct 2010 20:29:01 +0200 Subject: use eEnv::resolve() / eEnv.resolve() --- main/bsod.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'main/bsod.cpp') diff --git a/main/bsod.cpp b/main/bsod.cpp index 68b5d571..c0362832 100755 --- a/main/bsod.cpp +++ b/main/bsod.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -65,7 +66,7 @@ static void addToLogbuffer(int level, const std::string &log) static std::string getConfigFileValue(const char *entry) { - std::string configfile = "/etc/enigma2/settings"; + std::string configfile = eEnv::resolve("${sysconfdir}/enigma2/settings"); std::string configvalue; if (entry) { @@ -140,8 +141,8 @@ static std::string getFileContent(const char *file) return filecontent; } -static std::string execCommand(char* cmd) { - FILE* pipe = popen(cmd, "r"); +static std::string execCommand(std::string cmd) { + FILE* pipe = popen(cmd.c_str(), "r"); if (!pipe) return "Error"; char buffer[STDBUFFER_SIZE]; @@ -156,11 +157,6 @@ static std::string execCommand(char* cmd) { return result; } -extern std::string execCommand(); -extern std::string getConfigFileValue(); -extern std::string getFileContent(); -extern std::string getLogBuffer(); - #define INFOFILE "/maintainer.info" void bsodFatal(const char *component) @@ -274,7 +270,7 @@ void bsodFatal(const char *component) dreamboxca[strlen(dreamboxca)-1] = 0; fprintf(f, "\t\t\n\t\t\n\t\t\n", dreamboxca); } - std::string settings = getFileContent("/etc/enigma2/settings"); + std::string settings = getFileContent(eEnv::resolve("${sysconfdir}/enigma2/settings").c_str()); if (settings != "Error") { fprintf(f, "\t\t\n\t\t\n\t\t\n", settings.c_str()); @@ -336,7 +332,7 @@ void bsodFatal(const char *component) fprintf(f, "\t\n"); std::string buffer = getLogBuffer(); fprintf(f, "\t\t\n\t\t\n\t\t\n", buffer.c_str()); - std::string pythonmd5 = execCommand("find /usr/lib/enigma2/python/ -name \"*.py\" | xargs md5sum"); + std::string pythonmd5 = execCommand("find " + eEnv::resolve("${libdir}/enigma2/python/") + " -name \"*.py\" | xargs md5sum"); fprintf(f, "\t\t\n\t\t\n\t\t\n", pythonmd5.c_str()); fprintf(f, "\t\n"); -- cgit v1.2.3