mirror of
https://github.com/phatina/simple-mtpfs
synced 2025-02-16 11:47:12 +00:00
introduce configure option for TMPDIR
This commit is contained in:
parent
e080bed017
commit
3442a88dfa
18
configure.ac
18
configure.ac
@ -29,6 +29,24 @@ PKG_CHECK_MODULES(
|
||||
AC_SUBST([LIBUSB1_CFLAGS])
|
||||
AC_SUBST([LIBUSB1_LIBS])
|
||||
|
||||
dnl Configurable temporary directory
|
||||
AC_ARG_WITH(
|
||||
[tmpdir],
|
||||
[AS_HELP_STRING([--with-tmpdir@<:=DIR@:>@],
|
||||
[Directory for temporary files, defaults to /tmp])],
|
||||
[], []
|
||||
)
|
||||
AS_IF(
|
||||
[test "x$withval" != "x"],
|
||||
[tmpdir="$withval"],
|
||||
[tmpdir="/tmp"]
|
||||
)
|
||||
AC_DEFINE_UNQUOTED(
|
||||
[TMPDIR],
|
||||
["${tmpdir}"],
|
||||
[Directory for temporary files]
|
||||
)
|
||||
|
||||
AC_OUTPUT([
|
||||
makefile
|
||||
src/makefile
|
||||
|
@ -782,7 +782,7 @@ bool SMTPFileSystem::createTmpDir()
|
||||
} else {
|
||||
c_tmp = getenv("TMPDIR");
|
||||
if (!c_tmp)
|
||||
c_tmp = "/tmp";
|
||||
c_tmp = TMPDIR;
|
||||
tmp_dir = smtpfs_realpath(c_tmp);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "simple-mtpfs-sha1.h"
|
||||
|
||||
TmpFilesPool::TmpFilesPool():
|
||||
m_tmp_path("/tmp/simple-mtpfs"),
|
||||
m_tmp_path(TMPDIR "/simple-mtpfs"),
|
||||
m_pool()
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user