Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/service-host.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ function serviceHost(serviceName)
else
{
this._checkpid = require('child_process').execFile('/bin/sh', ['sh']);
this._checkpid.stdout.result = '';
this._checkpid.stdout.on('data', function (chunk) { this.result += chunk.toString(); });
this._checkpid.stdout.str = '';
this._checkpid.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
switch(platformType)
{
case 'init':
Comment on lines 261 to 268

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 🟠 child_process stdout accumulation uses ad-hoc .result property instead of the .str convention

In the run function's linux branch, renamed this._checkpid.stdout.result to this._checkpid.stdout.str at initialization and inside the 'data' event listener (this.str += chunk.toString()), and updated the two subsequent reads (this._checkpid.stdout.str != '' and parseInt(this._checkpid.stdout.str)) to match, aligning with the .str convention used in the darwin branch just below.

🤖 Prompt for AI agents
In modules/service-host.js around line 252, review and complete this code-review fix: child_process stdout accumulation uses ad-hoc `.result` property instead of the `.str` convention.
What the draft fix changed: In the `run` function's linux branch, renamed `this._checkpid.stdout.result` to `this._checkpid.stdout.str` at initialization and inside the 'data' event listener (`this.str += chunk.toString()`), and updated the two subsequent reads (`this._checkpid.stdout.str != ''` and `parseInt(this._checkpid.stdout.str)`) to match, aligning with the `.str` convention used in the darwin branch just below.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟢 92 high — react 👍/👎 to teach the reviewer

Expand All @@ -274,7 +274,7 @@ function serviceHost(serviceName)
}
this._checkpid.waitExit();

if(this._checkpid.stdout.result != '' && parseInt(this._checkpid.stdout.result) == process.pid)
if(this._checkpid.stdout.str != '' && parseInt(this._checkpid.stdout.str) == process.pid)
{
this.emit('serviceStart');
}
Expand Down Expand Up @@ -319,4 +319,4 @@ module.exports = serviceHost;
module.exports.create = function create(options)
{
return (new serviceHost(options));
};
};