diff options
author | Kacper Kasper <kacperkasper@gmail.com> | 2018-08-05 23:04:09 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-08-29 11:18:50 +0200 |
commit | 41427a5682ba83167f3b0abfa0e1e61b9ea6fa9d (patch) | |
tree | 08864ab672e2f8fd1af124ae6d7f8578a847385d /sal | |
parent | 5f60f6fe1475491ac0c2f529fb2d074c32336add (diff) |
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.meeks@collabora.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/security.cxx | 35 |
1 files changed, 34 insertions, 1 deletions
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" |