From a3ede548899a899c63231f0851eed5f9e0d7e8cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Wed, 24 Mar 2010 16:29:00 +0100 Subject: [PATCH] Bugfix: Bad files descriptor should be history now. Had this multiple times in a row, but after the change I have't seen any to date. --- PBEasyPipe.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PBEasyPipe.m b/PBEasyPipe.m index feaf6f8..91ef50a 100644 --- a/PBEasyPipe.m +++ b/PBEasyPipe.m @@ -48,7 +48,7 @@ NSLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir); #endif - NSPipe* pipe = [NSPipe pipe]; + NSPipe* pipe = [[NSPipe alloc] init]; [task setStandardOutput:pipe]; [task setStandardError:pipe]; return task; @@ -74,8 +74,8 @@ NSFileHandle * handle = [[task standardOutput] fileHandleForReading]; if (input) { - [task setStandardInput:[NSPipe pipe]]; - NSFileHandle * inHandle = [task.standardInput fileHandleForWriting]; + [task setStandardInput:[[NSPipe alloc] init]]; + NSFileHandle * inHandle = [[task standardInput] fileHandleForWriting]; [inHandle writeData:[input dataUsingEncoding:NSUTF8StringEncoding]]; [inHandle closeFile]; }