Also relying on $TMPDIR is problematic because Discord uses NSTemporaryDirectory() which may not be the same.
This commit is contained in:
parent
b59cd4fcd8
commit
a60249ff87
|
@ -9,6 +9,10 @@
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#if defined(OSX)
|
||||||
|
extern "C" void CFTemporaryDirectory(char *s, size_t len);
|
||||||
|
#endif
|
||||||
|
|
||||||
struct BaseConnectionUnix : public BaseConnection {
|
struct BaseConnectionUnix : public BaseConnection {
|
||||||
int sock{-1};
|
int sock{-1};
|
||||||
};
|
};
|
||||||
|
@ -23,12 +27,18 @@ static int MsgFlags = 0;
|
||||||
|
|
||||||
static const char* GetTempPath(void)
|
static const char* GetTempPath(void)
|
||||||
{
|
{
|
||||||
|
#if defined(OSX)
|
||||||
|
static char temp[1024];
|
||||||
|
CFTemporaryDirectory(temp, 1024);
|
||||||
|
return temp;
|
||||||
|
#else
|
||||||
const char* temp = getenv("XDG_RUNTIME_DIR");
|
const char* temp = getenv("XDG_RUNTIME_DIR");
|
||||||
temp = temp ? temp : getenv("TMPDIR");
|
temp = temp ? temp : getenv("TMPDIR");
|
||||||
temp = temp ? temp : getenv("TMP");
|
temp = temp ? temp : getenv("TMP");
|
||||||
temp = temp ? temp : getenv("TEMP");
|
temp = temp ? temp : getenv("TEMP");
|
||||||
temp = temp ? temp : "/tmp";
|
temp = temp ? temp : "/tmp";
|
||||||
return temp;
|
return temp;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ BaseConnection* BaseConnection::Create()
|
/*static*/ BaseConnection* BaseConnection::Create()
|
||||||
|
|
|
@ -139,7 +139,7 @@ static void CFSearchPathForDirectoriesInDomains(
|
||||||
CFStringGetCString(array_val, s, len, kCFStringEncodingUTF8);
|
CFStringGetCString(array_val, s, len, kCFStringEncodingUTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CFTemporaryDirectory(char *s, size_t len)
|
void CFTemporaryDirectory(char *s, size_t len)
|
||||||
{
|
{
|
||||||
#if __has_feature(objc_arc)
|
#if __has_feature(objc_arc)
|
||||||
CFStringRef path = (__bridge CFStringRef)NSTemporaryDirectory();
|
CFStringRef path = (__bridge CFStringRef)NSTemporaryDirectory();
|
||||||
|
|
|
@ -1692,5 +1692,8 @@ STEAM INTEGRATION USING MIST
|
||||||
#ifdef HAVE_MIST
|
#ifdef HAVE_MIST
|
||||||
#include "../steam/steam.c"
|
#include "../steam/steam.c"
|
||||||
#include "../tasks/task_steam.c"
|
#include "../tasks/task_steam.c"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_PRESENCE
|
||||||
#include "../network/presence.c"
|
#include "../network/presence.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -57,6 +57,7 @@ OTHER_CFLAGS = $(inherited) -DHAVE_OPENGL_CORE
|
||||||
OTHER_CFLAGS = $(inherited) -DHAVE_OVERLAY
|
OTHER_CFLAGS = $(inherited) -DHAVE_OVERLAY
|
||||||
OTHER_CFLAGS = $(inherited) -DHAVE_OZONE
|
OTHER_CFLAGS = $(inherited) -DHAVE_OZONE
|
||||||
OTHER_CFLAGS = $(inherited) -DHAVE_PATCH
|
OTHER_CFLAGS = $(inherited) -DHAVE_PATCH
|
||||||
|
OTHER_CFLAGS = $(inherited) -DHAVE_PRESENCE
|
||||||
OTHER_CFLAGS = $(inherited) -DHAVE_RBMP
|
OTHER_CFLAGS = $(inherited) -DHAVE_RBMP
|
||||||
OTHER_CFLAGS = $(inherited) -DHAVE_REWIND
|
OTHER_CFLAGS = $(inherited) -DHAVE_REWIND
|
||||||
OTHER_CFLAGS = $(inherited) -DHAVE_RGUI
|
OTHER_CFLAGS = $(inherited) -DHAVE_RGUI
|
||||||
|
|
Loading…
Reference in New Issue