Skip to content

Commit 51766b0

Browse files
lib: add timedOut flag on child process spawn
1 parent 0f461aa commit 51766b0

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

lib/child_process.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ function spawn(file, args, options) {
764764
let timeoutId = setTimeout(() => {
765765
if (timeoutId) {
766766
try {
767+
child.timedOut = true;
767768
child.kill(killSignal);
768769
} catch (err) {
769770
child.emit('error', err);

lib/internal/child_process.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ function ChildProcess() {
263263
this.exitCode = null;
264264
this.killed = false;
265265
this.spawnfile = null;
266+
this.timedOut = false;
266267

267268
this._handle = new Process();
268269
this._handle[owner_symbol] = this;

0 commit comments

Comments
 (0)