From ff147981c609fac7f45c72de150b57600f44e8e5 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Wed, 15 Apr 2009 21:28:13 -0400 Subject: [PATCH] Add --with-hal-mount-dir configure option This allows the temporary mount directory used by the HAL callout to be specified at build time. This helps on distributions that limit the processes that can write to /tmp, which was the previous default. --- configure.ac | 5 +++++ tools/hal-callout.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index b41c16a..ae4a377 100644 --- a/configure.ac +++ b/configure.ac @@ -115,6 +115,11 @@ AC_ARG_WITH(hal_fdi_dir, AC_HELP_STRING([--with-hal-fdi-dir=DIR], HALFDIDIR="$with_hal_fdi_dir" AC_SUBST(HALFDIDIR) +AC_ARG_WITH(hal_mount_dir, AC_HELP_STRING([--with-hal-mount-dir=DIR], + [Directory where the HAL callout will temporarily mount devices]), + AC_DEFINE_UNQUOTED([HALMOUNTDIR], ["$with_hal_mount_dir"], + [Directory where the HAL callout will temporarily mount devices]),) + if test "x$with_hal" != "xno"; then PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, enable_hal=yes, enable_hal=no) if test "x$enable_hal" != "xyes" -a "x$with_hal" = "xyes"; then diff --git a/tools/hal-callout.c b/tools/hal-callout.c index e7313fe..e3c8761 100644 --- a/tools/hal-callout.c +++ b/tools/hal-callout.c @@ -46,13 +46,19 @@ static char *mount_ipod (const char *dev_path) char *filename; char *tmpname; const char *fstype; + const char *tmpdir; int result; fstype = g_getenv ("HAL_PROP_VOLUME_FSTYPE"); if (fstype == NULL) { return NULL; } - filename = g_build_filename (g_get_tmp_dir (), "ipodXXXXXX", NULL); +#ifdef HALMOUNTDIR + tmpdir = HALMOUNTDIR; +#else + tmpdir = g_get_tmp_dir (); +#endif + filename = g_build_filename (tmpdir, "ipodXXXXXX", NULL); if (filename == NULL) { return NULL; } -- 1.6.2.3