Skip to content
Snippets Groups Projects
Commit d6a1a803 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

now makes sure to capture *all* input

Rev: NT/tools/sprshd:1.5
parent 66764455
No related branches found
No related tags found
No related merge requests found
......@@ -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));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment