| 251 | | fileHandle = [[NSFileHandle alloc] initWithFileDescriptor:fileno(fp) closeOnDealloc:YES]; |
|---|
| 252 | | data = [fileHandle availableData]; |
|---|
| 253 | | [[WCLogController logController] log:[NSString stringWithData:data encoding:NSUTF8StringEncoding]]; |
|---|
| 254 | | [fileHandle release]; |
|---|
| | 251 | pid = wait3(&status, WNOHANG, NULL); |
|---|
| | 252 | |
|---|
| | 253 | if(pid > 0) { |
|---|
| | 254 | fileHandle = [[NSFileHandle alloc] initWithFileDescriptor:fileno(fp) closeOnDealloc:NO]; |
|---|
| | 255 | data = [fileHandle availableData]; |
|---|
| | 256 | [[WCLogController logController] log:[NSString stringWithData:data encoding:NSUTF8StringEncoding]]; |
|---|
| | 257 | [fileHandle release]; |
|---|
| | 258 | } |
|---|
| | 259 | |
|---|
| | 260 | fclose(fp); |
|---|