Kaydet (Commit) 9a8d327e authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Don't be fooled by the dummy libsofficeapp.so in the mergedlib case

Change-Id: If4bc9ee28091680fad78fbba585e0470f87dc830
üst 002368ea
...@@ -22,10 +22,10 @@ extern "C" ...@@ -22,10 +22,10 @@ extern "C"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/stat.h>
#ifndef _WIN32 #ifndef _WIN32
#include <unistd.h>
#include "dlfcn.h" #include "dlfcn.h"
#ifdef _AIX #ifdef _AIX
...@@ -74,9 +74,6 @@ extern "C" ...@@ -74,9 +74,6 @@ extern "C"
#else #else
#include <io.h>
#define F_OK 00
#include <windows.h> #include <windows.h>
#define TARGET_LIB "sofficeapp" ".dll" #define TARGET_LIB "sofficeapp" ".dll"
#define TARGET_MERGED_LIB "mergedlo" ".dll" #define TARGET_MERGED_LIB "mergedlo" ".dll"
...@@ -178,9 +175,12 @@ static LibreOfficeKit *lok_init_2( const char *install_path, const char *user_p ...@@ -178,9 +175,12 @@ static LibreOfficeKit *lok_init_2( const char *install_path, const char *user_p
dlhandle = _dlopen(imp_lib); dlhandle = _dlopen(imp_lib);
if (!dlhandle) if (!dlhandle)
{ {
// If TARGET_LIB exists, but dlopen failed for some reason, // If TARGET_LIB exists, and likely is a real library (not a
// don't try TARGET_MERGED_LIB. // small one-line text stub as in the --enable-mergedlib
if (access(imp_lib, F_OK) == 0) // case), but dlopen failed for some reason, don't try
// TARGET_MERGED_LIB.
struct stat st;
if (stat(imp_lib, &st) == 0 && st.st_size > 100)
{ {
fprintf(stderr, "failed to open library '%s': %s\n", fprintf(stderr, "failed to open library '%s': %s\n",
imp_lib, _dlerror()); imp_lib, _dlerror());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment