Skip to content

Commit a3ede54

Browse files
committed
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.
1 parent 1922798 commit a3ede54

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PBEasyPipe.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ + (NSTask *) taskForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSSt
4848
NSLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir);
4949
#endif
5050

51-
NSPipe* pipe = [NSPipe pipe];
51+
NSPipe* pipe = [[NSPipe alloc] init];
5252
[task setStandardOutput:pipe];
5353
[task setStandardError:pipe];
5454
return task;
@@ -74,8 +74,8 @@ + (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(
7474
NSFileHandle * handle = [[task standardOutput] fileHandleForReading];
7575

7676
if (input) {
77-
[task setStandardInput:[NSPipe pipe]];
78-
NSFileHandle * inHandle = [task.standardInput fileHandleForWriting];
77+
[task setStandardInput:[[NSPipe alloc] init]];
78+
NSFileHandle * inHandle = [[task standardInput] fileHandleForWriting];
7979
[inHandle writeData:[input dataUsingEncoding:NSUTF8StringEncoding]];
8080
[inHandle closeFile];
8181
}

0 commit comments

Comments
 (0)