Add a config.h parameter for base TMPDIR
This commit is contained in:
parent
fec4fd0e22
commit
6ebadf1d23
@ -1,9 +1,11 @@
|
|||||||
#ifndef DEF_CONFIG_H
|
#ifndef DEF_CONFIG_H
|
||||||
#define DEF_CONFIG_H
|
#define DEF_CONFIG_H
|
||||||
|
|
||||||
#define VERSION "1.3.4"
|
#define VERSION "1.3.5"
|
||||||
|
|
||||||
#define MAX_TASK_ID 10000 // max is set to MAX_TASK_ID-1
|
#define MAX_TASK_ID 10000 // max is set to MAX_TASK_ID-1
|
||||||
#define NEW_TASK_ID_MAX_RETRIES 10000 // number of retries before giving up
|
#define NEW_TASK_ID_MAX_RETRIES 10000 // number of retries before giving up
|
||||||
|
|
||||||
|
#define TMPDIR "/tmp" // Some Unix systems don't use /tmp as tmp dir (eg Android)
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -19,9 +19,12 @@ char* get_socket_path() {
|
|||||||
|
|
||||||
return socket_path;
|
return socket_path;
|
||||||
} else {
|
} else {
|
||||||
char* base_path = "/tmp/takl";
|
char* base_path = TMPDIR "/takl";
|
||||||
|
|
||||||
char* username = getenv("USER");
|
char* username = getenv("USER");
|
||||||
|
if (!username)
|
||||||
|
username = getenv("USERNAME");
|
||||||
|
|
||||||
assert(username != NULL);
|
assert(username != NULL);
|
||||||
|
|
||||||
char* socket_path = malloc(sizeof(char)*(strlen(base_path)+strlen(username)+1));
|
char* socket_path = malloc(sizeof(char)*(strlen(base_path)+strlen(username)+1));
|
||||||
|
Loading…
Reference in New Issue
Block a user