mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-04 09:33:30 +00:00
Updated linux behavior, so when finding X when it can't use ldconfig, it will try to load the library to make sure it works first. Previously, it would return the first result, which could cause problems the first result is for the wrong platform, ie 32 bit vs 64 bit
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -185,36 +185,82 @@ function monitorinfo()
|
|||||||
var files = fs.readdirSync('/usr/lib');
|
var files = fs.readdirSync('/usr/lib');
|
||||||
var files2;
|
var files2;
|
||||||
|
|
||||||
for (var i in files) {
|
for (var i = 0; i < files.length; ++i)
|
||||||
try {
|
{
|
||||||
if (files[i].split('libX11.so.').length > 1 && files[i].split('.').length == 3) {
|
try
|
||||||
|
{
|
||||||
|
if (files[i].split('libX11.so.').length > 1 && files[i].split('.').length == 3)
|
||||||
|
{
|
||||||
|
require('_GenericMarshal').CreateNativeProxy('/usr/lib/' + files[i]);
|
||||||
Object.defineProperty(this, 'Location_X11LIB', { value: '/usr/lib/' + files[i] });
|
Object.defineProperty(this, 'Location_X11LIB', { value: '/usr/lib/' + files[i] });
|
||||||
}
|
}
|
||||||
if (files[i].split('libXtst.so.').length > 1 && files[i].split('.').length == 3) {
|
if (files[i].split('libXtst.so.').length > 1 && files[i].split('.').length == 3)
|
||||||
|
{
|
||||||
|
require('_GenericMarshal').CreateNativeProxy('/usr/lib/' + files[i]);
|
||||||
Object.defineProperty(this, 'Location_X11TST', { value: '/usr/lib/' + files[i] });
|
Object.defineProperty(this, 'Location_X11TST', { value: '/usr/lib/' + files[i] });
|
||||||
}
|
}
|
||||||
if (files[i].split('libXext.so.').length > 1 && files[i].split('.').length == 3) {
|
if (files[i].split('libXext.so.').length > 1 && files[i].split('.').length == 3)
|
||||||
|
{
|
||||||
|
require('_GenericMarshal').CreateNativeProxy('/usr/lib/' + files[i]);
|
||||||
Object.defineProperty(this, 'Location_X11EXT', { value: '/usr/lib/' + files[i] });
|
Object.defineProperty(this, 'Location_X11EXT', { value: '/usr/lib/' + files[i] });
|
||||||
}
|
}
|
||||||
if (files[i].split('libXfixes.so.').length > 1 && files[i].split('.').length == 3)
|
if (files[i].split('libXfixes.so.').length > 1 && files[i].split('.').length == 3)
|
||||||
{
|
{
|
||||||
|
require('_GenericMarshal').CreateNativeProxy('/usr/lib/' + files[i]);
|
||||||
Object.defineProperty(this, 'Location_X11FIXES', { value: '/usr/lib/' + files[i] });
|
Object.defineProperty(this, 'Location_X11FIXES', { value: '/usr/lib/' + files[i] });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (files[i].split('-linux-').length > 1) {
|
if (files[i].split('-linux-').length > 1)
|
||||||
|
{
|
||||||
files2 = fs.readdirSync('/usr/lib/' + files[i]);
|
files2 = fs.readdirSync('/usr/lib/' + files[i]);
|
||||||
for (j in files2) {
|
for (j = 0; j < files2.length; ++j)
|
||||||
if (files2[j].split('libX11.so.').length > 1 && files2[j].split('.').length == 3) {
|
{
|
||||||
|
if (files2[j].split('libX11.so.').length > 1 && files2[j].split('.').length == 3)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
require('_GenericMarshal').CreateNativeProxy('/usr/lib/' + files[i] + '/' + files2[j]);
|
||||||
|
}
|
||||||
|
catch (xx)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
Object.defineProperty(this, 'Location_X11LIB', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
Object.defineProperty(this, 'Location_X11LIB', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
||||||
}
|
}
|
||||||
if (files2[j].split('libXtst.so.').length > 1 && files2[j].split('.').length == 3) {
|
if (files2[j].split('libXtst.so.').length > 1 && files2[j].split('.').length == 3)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
require('_GenericMarshal').CreateNativeProxy('/usr/lib/' + files[i] + '/' + files2[j]);
|
||||||
|
}
|
||||||
|
catch (xx)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
Object.defineProperty(this, 'Location_X11TST', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
Object.defineProperty(this, 'Location_X11TST', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
||||||
}
|
}
|
||||||
if (files2[j].split('libXext.so.').length > 1 && files2[j].split('.').length == 3) {
|
if (files2[j].split('libXext.so.').length > 1 && files2[j].split('.').length == 3)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
require('_GenericMarshal').CreateNativeProxy('/usr/lib/' + files[i] + '/' + files2[j]);
|
||||||
|
}
|
||||||
|
catch (xx)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
Object.defineProperty(this, 'Location_X11EXT', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
Object.defineProperty(this, 'Location_X11EXT', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
||||||
}
|
}
|
||||||
if (files2[j].split('libXfixes.so.').length > 1 && files2[j].split('.').length == 3)
|
if (files2[j].split('libXfixes.so.').length > 1 && files2[j].split('.').length == 3)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
require('_GenericMarshal').CreateNativeProxy('/usr/lib/' + files[i] + '/' + files2[j]);
|
||||||
|
}
|
||||||
|
catch (xx)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
Object.defineProperty(this, 'Location_X11FIXES', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
Object.defineProperty(this, 'Location_X11FIXES', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user