fix debugger not working on on FreeBSD

This commit is contained in:
nightwing 2015-07-08 16:12:17 +04:00
parent 70a0c84f40
commit fa7496364c

45
node_modules/vfs-local/localfs.js generated vendored
View File

@ -1610,29 +1610,30 @@ module.exports = function setup(fsOptions) {
function fetchPid(callback, retries){
if (!retries) retries = 0;
_execFile("ps", ["ax"], { maxBuffer: 1000 * 1024 },
function(err, stdout){
var matches = (stdout || "").split("\n").filter(function(line) {
return line.indexOf(watchFile) > -1
&& !/\-L cloud9[\d\.]+ new/.test(line)
&& line.indexOf("2> /dev/null") === -1;
});
// logToFile(options.session + ":" + JSON.stringify(matches));
if (!matches.length && retries < 10) {
// logToFile(options.session + ": RETRY MATCH");
setTimeout(fetchPid.bind(null, callback, ++retries), 30);
return;
}
callback(err, {
pid: matches && matches.length
? parseInt(matches[0].trim(), 10)
: -1
});
// can we use ps axwww instead of COLUMNS?
_execFile("ps", ["ax", "-opid,command"], {
maxBuffer: 1000 * 1024, env: {COLUMNS: 500}
}, function(err, stdout){
var matches = (stdout || "").split("\n").filter(function(line) {
return line.indexOf(watchFile) > -1
&& !/\-L cloud9[\d\.]+ new/.test(line)
&& line.indexOf("2> /dev/null") === -1;
});
// logToFile(options.session + ":" + JSON.stringify(matches));
if (!matches.length && retries < 10) {
// logToFile(options.session + ": RETRY MATCH");
setTimeout(fetchPid.bind(null, callback, ++retries), 30);
return;
}
callback(err, {
pid: matches && matches.length
? parseInt(matches[0].trim(), 10)
: -1
});
});
}
// Fetch PID of a running process and return it