pike.git
/
NT
/
tools
/
sprshd
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/NT/tools/sprshd:72:
io->close(); destruct(io); } } string opt_path(string p1, string p2) { return ( ( ((p1||"") + ";" + (p2||"")) / ";" ) - ({""}) ) * ";"; }
+
Thread.Mutex outlock=Thread.Mutex();
void myproxy(object pi, object io, int channel) { while(1) { string s=pi->read(1000,1); if(!s || !strlen(s)) break;
-
+
object key=outlock->lock();
io->write(sprintf("%c%3c%s",channel,strlen(s),channel,s));
-
+
destruct(key);
} } void handle_incoming_connection(object(Stdio.File) io) { object p; mapping env=copy_value(getenv()); sscanf(io->read(4),"%4c",int args); string *cmd=allocate(args); for(int e=0;e<args;e++)
pike.git/NT/tools/sprshd:274:
])); }; destruct(p2); destruct(pe2); if(!err) { #ifdef NO_IPC thread_create(monitor,p2,p); #endif
+
object proxythread;
if(env->__handles_stderr) {
-
thread_create(myproxy,pe,io,2);
+
proxythread=
thread_create(myproxy,pe,io,2);
myproxy(pi,io,1); }else{
-
thread_create(myproxy,pe,io,0);
+
proxythread=
thread_create(myproxy,pe,io,0);
myproxy(pi,io,0); }
-
+
proxythread->wait();
io->write(sprintf("%4c",0)); int code; if (catch { code = p->wait(); }) { // wait() failed. io->write(sprintf("%4c", -1)); } else { io->write(sprintf("%4c", code)); } }else{