@@ -32,17 +32,6 @@ FILE* SharedUtil::File::Fopen(const char* szFilename, const char* szMode)
32
32
{
33
33
return fopen (szFilename, szMode);
34
34
}
35
- bool SString::Contains (const SString& strOther) const
36
- {
37
- return find (strOther) != std::string::npos;
38
- }
39
- SString SharedUtil::GetSystemCurrentDirectory (void )
40
- {
41
- char szBuffer[MAX_PATH];
42
- getcwd (szBuffer, MAX_PATH - 1 );
43
- return szBuffer;
44
- }
45
- void HandleLinuxLibs (const SString& strLaunchDirectory, int argc, char * argv[]);
46
35
#endif
47
36
48
37
using namespace std ;
@@ -53,14 +42,6 @@ using namespace std;
53
42
#define LIB_CORE " ./" SERVER_BIN_PATH " core" MTA_LIB_SUFFIX MTA_LIB_EXTENSION
54
43
#endif
55
44
56
- #ifndef WIN32
57
- #ifdef ANY_x86
58
- #define LINUX_LIBS_PATH " x86/linux-libs"
59
- #else
60
- #define LINUX_LIBS_PATH " x64/linux-libs"
61
- #endif
62
- #endif
63
-
64
45
int main (int argc, char * argv[])
65
46
{
66
47
// Work out the launched directory and filename
@@ -102,7 +83,6 @@ int main(int argc, char* argv[])
102
83
printf (" -u Disable output buffering and flush instantly (useful for screenlog)\n " );
103
84
#ifndef WIN32
104
85
printf (" -x Disable simplified crash reports (To allow core dumps)\n " );
105
- printf (" -q Do not add " LINUX_LIBS_PATH " directory to library search path and relaunch\n " );
106
86
#endif
107
87
printf (" -D [PATH] Use as base directory\n " );
108
88
printf (" --config [FILE] Alternate mtaserver.conf file\n " );
@@ -125,8 +105,6 @@ int main(int argc, char* argv[])
125
105
cin.get ();
126
106
return 1 ;
127
107
}
128
- #else
129
- HandleLinuxLibs (strLaunchDirectory, argc, argv);
130
108
#endif
131
109
132
110
// If we are unable to access the core module, try changing to the directory of the launched file
@@ -176,53 +154,3 @@ int main(int argc, char* argv[])
176
154
cin.get ();
177
155
return 1 ;
178
156
}
179
-
180
- #ifndef WIN32
181
- //
182
- // Add linux-libs to library search path if:
183
- // 1. Options don't forbid it (-q)
184
- // 2. linux-libs is not already in the library search path
185
- //
186
- void HandleLinuxLibs (const SString& strLaunchDirectory, int argc, char * argv[])
187
- {
188
- // Check for linux-libs forbidden option
189
- for (int i = 1 ; i < argc; i++)
190
- {
191
- if (strcmp (argv[i], " -q" ) == 0 )
192
- return ;
193
- }
194
-
195
- // Calculate absolute path to MTA directory
196
- SString strSavedDir = GetSystemCurrentDirectory ();
197
- chdir (strLaunchDirectory);
198
- SString strAbsLaunchDirectory = GetSystemCurrentDirectory ();
199
- chdir (strSavedDir);
200
-
201
- SString strLdLibraryPath = getenv (" LD_LIBRARY_PATH" );
202
- SString strLinuxLibsPath = strAbsLaunchDirectory + " /" LINUX_LIBS_PATH;
203
-
204
- // Check that linux-libs is not already in library path
205
- if (!strLdLibraryPath.Contains (strLinuxLibsPath))
206
- {
207
- // Add linux-libs to search path
208
- if (!strLdLibraryPath.empty ())
209
- strLdLibraryPath += " ;" ;
210
- strLdLibraryPath += strLinuxLibsPath;
211
- SString strEnvString = SStringX (" LD_LIBRARY_PATH=" ) + strLdLibraryPath;
212
- putenv ((char *)*strEnvString);
213
-
214
- // Add -q to ensure linux-libs don't get added again
215
- char ** pArgArray = new char *[argc + 2 ];
216
- for (int i = 0 ; i <= argc; i++)
217
- {
218
- pArgArray[i] = argv[i];
219
- }
220
- char newArg[] = " -q" ;
221
- pArgArray[argc] = newArg;
222
- pArgArray[argc + 1 ] = nullptr ;
223
-
224
- // Go for launch #2
225
- execv (argv[0 ], pArgArray);
226
- }
227
- }
228
- #endif
0 commit comments