From d6a1a8032ce1bddfb5f7bab06e2eb63ca7a28a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Sun, 25 Jan 1998 00:18:46 -0800 Subject: [PATCH] now makes sure to capture *all* input Rev: NT/tools/sprshd:1.5 --- NT/tools/sprshd | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/NT/tools/sprshd b/NT/tools/sprshd index 82d2205814..a3d17f9863 100755 --- a/NT/tools/sprshd +++ b/NT/tools/sprshd @@ -2,6 +2,14 @@ inherit Stdio.Port; +void monitor(object(Stdio.File) io, object proc) +{ + proc->wait(); + io->close("rw"); + io->close(); + destruct(io); +} + void handle_incoming_connection(object(Stdio.File) io) { object p; @@ -60,12 +68,13 @@ void handle_incoming_connection(object(Stdio.File) io) "stdout":p2, "stderr":p2, "cwd":dir, - ])); }; + ])); + }; - destruct(p2); if(!err) { + thread_create(monitor,p2,p); while(1) { string s=pi->read(1000,1); @@ -76,6 +85,7 @@ void handle_incoming_connection(object(Stdio.File) io) io->write(sprintf("%4c",0)); io->write(sprintf("%4c",p->wait())); }else{ + destruct(p2); io->write(sprintf("%4c",0)); io->write(sprintf("%4c",69)); } -- GitLab