instsetoo_native/CustomTarget_setup.mk | 2 - sal/osl/unx/security.cxx | 35 ++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-)
New commits: commit 41427a5682ba83167f3b0abfa0e1e61b9ea6fa9d Author: Kacper Kasper <kacperkas...@gmail.com> AuthorDate: Sun Aug 5 23:04:09 2018 +0200 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Wed Aug 29 11:18:50 2018 +0200 sal: use correct settings path for Haiku * Don't lowercase the name. Change-Id: I8addd735bf8ee48256ec53f01063e96e7a4b41cd Reviewed-on: https://gerrit.libreoffice.org/58632 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.me...@collabora.com> diff --git a/instsetoo_native/CustomTarget_setup.mk b/instsetoo_native/CustomTarget_setup.mk index ebeb00dcd019..da4f697993df 100644 --- a/instsetoo_native/CustomTarget_setup.mk +++ b/instsetoo_native/CustomTarget_setup.mk @@ -40,7 +40,7 @@ $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_ && echo 'InstallMode=<installmode>' \ && echo 'ProductKey=$(PRODUCTNAME) $(PRODUCTVERSION)' \ $(if $(ENABLE_RELEASE_BUILD),\ - && echo 'UserInstallation=$$SYSUSERCONFIG/$(if $(filter-out MACOSX WNT,$(OS)),$(shell echo $(PRODUCTNAME) | tr "[:upper:]" "[:lower:]"),$(shell echo $(PRODUCTNAME) | sed -e 's/ /%20/g'))/4', \ + && echo 'UserInstallation=$$SYSUSERCONFIG/$(if $(filter-out HAIKU MACOSX WNT,$(OS)),$(shell echo $(PRODUCTNAME) | tr "[:upper:]" "[:lower:]"),$(shell echo $(PRODUCTNAME) | sed -e 's/ /%20/g'))/4', \ && echo 'UserInstallation=$$ORIGIN/..') \ ) > $@ diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx index 49a0320bc023..a7a47640c693 100644 --- a/sal/osl/unx/security.cxx +++ b/sal/osl/unx/security.cxx @@ -41,6 +41,11 @@ #include <crypt.h> #endif +#if defined HAIKU +#include <fs_info.h> +#include <FindDirectory.h> +#endif + #include "secimpl.hxx" #ifdef ANDROID @@ -246,6 +251,18 @@ static bool osl_psz_getHomeDir(oslSecurity Security, sal_Char* pszDirectory, sal if (pSecImpl == nullptr) return false; +#ifdef HAIKU + dev_t volume = dev_for_path("/boot"); + sal_Char homeDir[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH]; + status_t result = find_directory(B_USER_DIRECTORY, volume, false, homeDir, + sizeof(homeDir)); + if (result == B_OK && strlen(homeDir) < nMax) { + strcpy(pszDirectory, homeDir); + return true; + } + return false; +#endif + #ifdef ANDROID { sal_Bool bRet = sal_False; @@ -347,7 +364,23 @@ sal_Bool SAL_CALL osl_getConfigDir(oslSecurity Security, rtl_uString **pustrDire return bRet; } -#if !defined(MACOSX) && !defined(IOS) +#if defined HAIKU + +static bool osl_psz_getConfigDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax) +{ + (void) Security; + dev_t volume = dev_for_path("/boot"); + sal_Char configDir[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH]; + status_t result = find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, + configDir, sizeof(configDir)); + if (result == B_OK && strlen(configDir) < nMax) { + strcpy(pszDirectory, configDir); + return true; + } + return false; +} + +#elif !defined(MACOSX) && !defined(IOS) #define DOT_CONFIG "/.config" _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits