From ae3bff9e1842b55fa9b525886e7fde5df125af5c Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Sat, 22 Jun 2019 01:20:16 -0700 Subject: [PATCH] fixed getEnvFromPid() for freebsd --- modules/user-sessions.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/user-sessions.js b/modules/user-sessions.js index d407b4f..5d919e1 100644 --- a/modules/user-sessions.js +++ b/modules/user-sessions.js @@ -622,8 +622,9 @@ function UserSessions() { var child = require('child_process').execFile('/bin/sh', ['sh']); child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); }); - child.stdin.write("procstat -e " + pid + " | grep " + pid + " | awk '{ $1=\"\"; $2=\"\"; print $0 }' | tr \"\\ \" \"\\n\" | awk -F= '{ if($1==\"\") { print $0 }}'\nexit\n"); + child.stdin.write("procstat -e " + pid + " | grep " + pid + " | awk '{ $1=\"\"; $2=\"\"; print $0 }' | tr \"\\ \" \"\\n\"\nexit\n"); child.waitExit(); + var env; var tokens = child.stdout.str.trim().split('\n'); for(var i in tokens) @@ -887,4 +888,4 @@ function getTokens(str) return (columns); } -module.exports = new UserSessions(); \ No newline at end of file +module.exports = new UserSessions();