1
0
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:
Peter Hatina 2013-11-18 20:11:10 +01:00
parent e080bed017
commit 3442a88dfa
3 changed files with 20 additions and 2 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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()
{
}