summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-04-14 14:22:40 +0200
committerMathias Bauer <mba@openoffice.org>2010-04-14 14:22:40 +0200
commitf4f8addcaf340d3ad05d04f40c43f80c27d7b8e3 (patch)
tree915ae76bdfc4e6de5de97eff2e3752532359ba92
parentdc20aef81b2c6cac2fa175aad32bada6630a0aa0 (diff)
parent2421e3d1a540110054f9e4a54bbe6ee41c6d774a (diff)
CWS nspluginglobal: merge commit
-rw-r--r--extensions/source/nsplugin/source/so_env.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/extensions/source/nsplugin/source/so_env.cxx b/extensions/source/nsplugin/source/so_env.cxx
index f67853c90449..4cce0f98cd4f 100644
--- a/extensions/source/nsplugin/source/so_env.cxx
+++ b/extensions/source/nsplugin/source/so_env.cxx
@@ -31,7 +31,9 @@
#ifdef UNIX
#include <sys/types.h>
#include <strings.h>
+#ifdef LINUX
#include <dlfcn.h>
+#endif
#include <stdarg.h>
// For vsnprintf()
#define NSP_vsnprintf vsnprintf
@@ -120,7 +122,7 @@ restoreUTF8(char *pPath)
return 0;
}
-#ifdef UNIX
+#ifdef LINUX
extern int nspluginOOoModuleHook (void** aResult);
int nspluginOOoModuleHook (void** aResult)
{
@@ -240,12 +242,15 @@ int findReadSversion(void** aResult, int /*bWnt*/, const char* /*tag*/, const ch
char lnkFileName[NPP_PATH_MAX] = {0};
char* pTempZero = NULL;
+#ifdef LINUX
/* try to fetch a 'self' pointer */
if (!nspluginOOoModuleHook (aResult))
return 0;
/* .. now in $HOME */
+#endif
sprintf(lnkFileName, "%s/.mozilla/plugins/libnpsoplugin%s", getenv("HOME"), SAL_DLLEXTENSION);
+#ifdef LINUX
ssize_t len = readlink(lnkFileName, realFileName, NPP_PATH_MAX-1);
if (-1 == len)
{
@@ -255,6 +260,10 @@ int findReadSversion(void** aResult, int /*bWnt*/, const char* /*tag*/, const ch
realFileName[len] = '\0';
if (NULL == (pTempZero = strstr(realFileName, "/program/libnpsoplugin" SAL_DLLEXTENSION)))
+#else
+ if ((0 > readlink(lnkFileName, realFileName, NPP_PATH_MAX)) ||
+ (NULL == (pTempZero = strstr(realFileName, "/program/libnpsoplugin" SAL_DLLEXTENSION))))
+#endif
{
*realFileName = 0;
return -1;