Fixed how Linux registers the discord executable
This commit is contained in:
parent
0c459294bb
commit
10e8af83ba
|
@ -104,8 +104,10 @@ static void register_launch_command(void) {
|
||||||
}
|
}
|
||||||
GetModuleFileName(hModule, cmd, sizeof(cmd));
|
GetModuleFileName(hModule, cmd, sizeof(cmd));
|
||||||
#else
|
#else
|
||||||
rc = readlink("/proc/self/exe", cmd, sizeof(MAX_LAUNCH_CMD) - 1);
|
char path[MAX_LAUNCH_CMD] = { 0 };
|
||||||
if (rc) {
|
snprintf(path, MAX_LAUNCH_CMD - 1, "/proc/%d/exe", getpid());
|
||||||
|
rc = readlink(path, cmd, MAX_LAUNCH_CMD - 1);
|
||||||
|
if (rc <= 0) {
|
||||||
LOG_ERROR("unable to retrieve absolute path! rc = %d", rc);
|
LOG_ERROR("unable to retrieve absolute path! rc = %d", rc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue