mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-02 00:23:17 +00:00
Fixed bug, where stderr was not subscribed, causing the stream to pause if stderr is written to, which will happen on Win Server when fetching AV state. If stream is paused, the waitExit() line will hang
This commit is contained in:
@@ -44,6 +44,7 @@ function av()
|
||||
{
|
||||
var child = require('child_process').execFile(process.env['windir'] + '\\System32\\wbem\\wmic.exe', ['wmic', '/Namespace:\\\\root\\SecurityCenter2', 'Path', 'AntiVirusProduct', 'get', '/FORMAT:CSV']);
|
||||
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
|
||||
child.stderr.str = ''; child.stderr.on('data', function (c) { this.str += c.toString(); })
|
||||
child.waitExit();
|
||||
|
||||
var lines = child.stdout.str.trim().split('\r\n');
|
||||
|
||||
Reference in New Issue
Block a user