mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-06 18:43:46 +00:00
1. Fixed windows null dereference crash
2. Updated Linux KVM support check, to check if X is apawned, which fixes cases where X libraries are present, but X isn't running.
This commit is contained in:
@@ -205,7 +205,20 @@ function monitorinfo()
|
||||
|
||||
if(process.platform == 'linux' || process.platform == 'freebsd')
|
||||
{
|
||||
Object.defineProperty(this, 'kvm_x11_support', { value: (this.Location_X11LIB && this.Location_X11TST && this.Location_X11EXT)?true:false });
|
||||
if (this.Location_X11LIB && this.Location_X11TST && this.Location_X11EXT)
|
||||
{
|
||||
var ch = require('child_process').execFile('/bin/sh', ['sh']);
|
||||
ch.stderr.on('data', function () { });
|
||||
ch.stdout.str = ''; ch.stdout.on('data', function (c) { this.str += c.toString(); });
|
||||
ch.stdin.write('ps -e | grep X\nexit\n');
|
||||
ch.waitExit();
|
||||
Object.defineProperty(this, 'kvm_x11_support', { value: ch.stdout.str.trim() == '' ? false : true });
|
||||
}
|
||||
else
|
||||
{
|
||||
Object.defineProperty(this, 'kvm_x11_support', { value: false });
|
||||
}
|
||||
|
||||
|
||||
if (this.Location_X11LIB)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user