pike.git
/
NT
/
tools
/
sprshd
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/NT/tools/sprshd:66:
{ proc->wait(); if(io) { io->close("rw"); io->close(); destruct(io); } }
-
#ifdef WINE
-
void my_proxy(Stdio.File from, Stdio.File to)
-
{
-
while(string s=from->read(128,1))
-
if(to->write(s)!=strlen(s))
-
return;
-
-
}
-
#endif
-
+
string opt_path(string p1, string p2) { return ( ( ((p1||"") + ";" + (p2||"")) / ";" ) - ({""}) ) * ";"; } void handle_incoming_connection(object(Stdio.File) io) { object p; mapping env=copy_value(getenv()); sscanf(io->read(4),"%4c",int args);
pike.git/NT/tools/sprshd:213:
s=(env[cmd[1]] || "")+"\n"; } io->write(sprintf("%4c%s",strlen(s),s)); io->write(sprintf("%4c",0)); io->write(sprintf("%4c",0)); break; } default: #ifdef WINE
+
void my_proxy(Stdio.File from, Stdio.File to)
{
-
+
while(string s=from->read(128,1))
+
if(to->write(s)!=strlen(s))
+
return;
+
if(p) p->kill(9); /* DIE! */
+
}
+
+
{
werror("Proxying.....\n"); object p3=Stdio.File(); #ifdef NO_IPC object p4=p3->pipe(); #else object p4=p3->pipe(Stdio.PROP_IPC); #endif thread_create(my_proxy,io,p4); io=p3; } #endif
-
+
#if __VERSION__ >= 0.699999
+
write("Trapping OOB\n");
+
if(io->read_oob)
+
{
+
thread_create(lambda() {
+
while(1)
+
{
+
string tmp=io->read_oob(1);
+
if(!tmp || !sizeof(tmp)) return;
+
werror("**Interrupt received, killing child.\n");
+
p->kill(9);
+
}
+
});
+
}
+
#endif
+
mixed err=catch { p=Process.create_process(cmd, ([ #ifndef WINE "stdin":io, "stdout":p2, "stderr":p2, #endif "cwd":dir, "env":env,