diff --git a/libreoffice/desktop/unx/source/start.c b/libreoffice/desktop/unx/source/start.c index a488f95..5fa0d8e 100644 --- a/libreoffice/desktop/unx/source/start.c +++ b/libreoffice/desktop/unx/source/start.c @@ -289,6 +289,7 @@ get_pipe_path( rtl_uString *pAppPath ) rtlBootstrapHandle handle; rtl_uString *pMd5hash = NULL; sal_Unicode pUnicode[RTL_USTR_MAX_VALUEOFINT32]; + char *env_tmpdir; /* setup bootstrap filename */ rtl_uString_newFromAscii( &pPath, "file://" ); @@ -318,7 +319,10 @@ get_pipe_path( rtl_uString *pAppPath ) if ( !pMd5hash ) rtl_uString_new( &pMd5hash ); - if ( access( PIPEDEFAULTPATH, R_OK|W_OK ) == 0 ) + env_tmpdir = getenv("TMPDIR"); + if ( access( env_tmpdir, R_OK|W_OK ) == 0 ) + rtl_uString_newFromAscii( &pResult, env_tmpdir ); + else if ( access( PIPEDEFAULTPATH, R_OK|W_OK ) == 0 ) rtl_uString_newFromAscii( &pResult, PIPEDEFAULTPATH ); else rtl_uString_newFromAscii( &pResult, PIPEALTERNATEPATH ); diff --git a/libreoffice/sal/osl/unx/pipe.c b/libreoffice/sal/osl/unx/pipe.c index f0f91da..731ec61 100644 --- a/libreoffice/sal/osl/unx/pipe.c +++ b/libreoffice/sal/osl/unx/pipe.c @@ -187,13 +187,19 @@ oslPipe SAL_CALL osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions int Flags; size_t len; struct sockaddr_un addr; + char *env_tmpdir; sal_Char name[PATH_MAX + 1]; size_t nNameLength = 0; int bNameTooLong = 0; oslPipe pPipe; - if (access(PIPEDEFAULTPATH, R_OK|W_OK) == 0) + env_tmpdir = getenv("TMPDIR"); + if (access(env_tmpdir, R_OK|W_OK) == 0) + { + strncpy(name, env_tmpdir, sizeof(name)); + } + else if (access(PIPEDEFAULTPATH, R_OK|W_OK) == 0) { strncpy(name, PIPEDEFAULTPATH, sizeof(name)); }