Jack Settings bug fixes.

This commit is contained in:
Robin Davies
2021-08-30 04:34:07 -04:00
parent 57ecc0d9ef
commit 6cb1300cc9
7 changed files with 135 additions and 39 deletions
+11
View File
@@ -24,6 +24,7 @@
#include "PiPedalException.hpp"
#include <string.h>
#include <unistd.h>
#include <linux/limits.h> // for PATH_MAX
using namespace pipedal;
using namespace std;
@@ -129,4 +130,14 @@ int pipedal::SysExec(const char *szCommand)
int exitStatus = WEXITSTATUS(returnValue);
return exitStatus;
}
}
std::string pipedal::GetSelfExePath()
{
char result[PATH_MAX+1];
ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
if (count < 0) throw PiPedalException("Can't find EXE path.");
result[count] = 0;
return result;
}