Fixes.
This commit is contained in:
parent
a09f856c0d
commit
75c5af4575
1 changed files with 6 additions and 3 deletions
|
@ -77,9 +77,12 @@ namespace Controller {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
FILE * output = fdopen((long long int)err, "r");
|
FILE * output = fdopen((long long int)err, "r");
|
||||||
while (fgets(buf, 1024, output)){
|
while (fgets(buf, 1024, output)){
|
||||||
for (unsigned int i = 0; i < 9 && buf[i] != ' '; i++){}
|
unsigned int i = 0;
|
||||||
|
while (i < 9 && buf[i] != ' '){
|
||||||
|
++i;
|
||||||
|
}
|
||||||
if(i < 9){
|
if(i < 9){
|
||||||
buf[i] = NULL;
|
buf[i] = 0;
|
||||||
Log(buf,buf+i+1);
|
Log(buf,buf+i+1);
|
||||||
}else{
|
}else{
|
||||||
printf("%s\n",buf);
|
printf("%s\n",buf);
|
||||||
|
@ -162,7 +165,7 @@ namespace Controller {
|
||||||
Util::Procs::StartPiped(toConn(iter->first), argarr, &zero, &out, &err);//redirects output to out. Must make a new pipe, redirect std err
|
Util::Procs::StartPiped(toConn(iter->first), argarr, &zero, &out, &err);//redirects output to out. Must make a new pipe, redirect std err
|
||||||
if(err != -1){
|
if(err != -1){
|
||||||
//spawn new thread where err is read, it reads err until there is nothing more to be read
|
//spawn new thread where err is read, it reads err until there is nothing more to be read
|
||||||
tthread::thread * msghandler = new tthread::thread(handleMsg, (void*) err);
|
tthread::thread * msghandler = new tthread::thread(handleMsg, (void*)err);
|
||||||
msghandler->detach();
|
msghandler->detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue