mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-24 04:04:31 +00:00
Added try/catch around getLibInfo() to fix an issue on ChromeOS
This commit is contained in:
@@ -46,10 +46,17 @@ function getLibInfo(libname)
|
||||
child.stdout.str = '';
|
||||
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
|
||||
child.stdin.write(ldconfig + " -p | grep '" + libname + ".so.' | tr '\\n' '^' | awk -F^ '{ printf \"[\"; for(i=1;i<=NF;++i) {" + ' split($i, plat, ")"); split(plat[1], plat2, "("); ifox=split(plat2[2], ifo, ","); libc=""; hwcap="0"; for(ifoi=1;ifoi<=ifox;++ifoi) { if(split(ifo[ifoi], jnk, "libc")==2) { libc=ifo[ifoi]; } if(split(ifo[ifoi], jnk, "hwcap:")==2) { split(ifo[ifoi], jnk, "0x"); hwcap=jnk[2]; } } x=split($i, tok, " "); if(tok[1]!="") { printf "%s{\\"lib\\": \\"%s\\", \\"path\\": \\"%s\\", \\"hwcap\\": \\"%s\\", \\"libc\\": \\"%s\\"}", (i!=1?",":""), tok[1], tok[x], hwcap, libc; }} printf "]"; }\'\nexit\n');
|
||||
|
||||
child.waitExit();
|
||||
var v = JSON.parse(child.stdout.str.trim());
|
||||
return (v);
|
||||
|
||||
try
|
||||
{
|
||||
var v = JSON.parse(child.stdout.str.trim());
|
||||
return (v);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
return ({});
|
||||
}
|
||||
}
|
||||
|
||||
function monitorinfo()
|
||||
|
||||
Reference in New Issue
Block a user