mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 12:39:01 -04:00
Some platforms doesn't have a /tmp/ directory where temporary files can be
stored. Make it possible to override that location compile time.
This commit is contained in:
parent
5ddfc2131c
commit
2211bb8f97
3
Makefile
3
Makefile
@ -13,6 +13,7 @@ MAN_DIR?=$(PREFIX)/share/man
|
||||
SHARE_DIR=$(PREFIX)/share/kore
|
||||
INCLUDE_DIR=$(PREFIX)/include/kore
|
||||
TLS_BACKEND?=openssl
|
||||
KORE_TMPDIR?=/tmp
|
||||
|
||||
TOOLS= kore-serve
|
||||
|
||||
@ -56,7 +57,7 @@ endif
|
||||
endif
|
||||
|
||||
ifneq ("$(KORE_SINGLE_BINARY)", "")
|
||||
CFLAGS+=-DKORE_SINGLE_BINARY
|
||||
CFLAGS+=-DKORE_SINGLE_BINARY -DKORE_TMPDIR='"$(KORE_TMPDIR)"'
|
||||
FEATURES+=-DKORE_SINGLE_BINARY
|
||||
endif
|
||||
|
||||
|
@ -761,7 +761,8 @@ config_file_write(void)
|
||||
int fd, len;
|
||||
char fpath[MAXPATHLEN];
|
||||
|
||||
len = snprintf(fpath, sizeof(fpath), "/tmp/%s.XXXXXX", __progname);
|
||||
len = snprintf(fpath, sizeof(fpath), "%s/%s.XXXXXX", KORE_TMPDIR,
|
||||
__progname);
|
||||
if (len == -1 || (size_t)len >= sizeof(fpath))
|
||||
fatal("failed to create temporary path");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user