Use old API to launch tasks on all versions of macOS

This commit is contained in:
Matt Hardcastle 2019-06-24 14:27:07 -07:00
parent 4f6e2c85f9
commit 9ae67c15b2

View file

@ -23,24 +23,14 @@
NSLog(@"calling interface at %@", self->pathTo);
if (@available(macOS 10.13, *)) {
NSError *error = nil;
if (![interface launchAndReturnError:&error]) {
*outError = [NSError errorWithDomain:@"interface"
code:-1
userInfo:@{NSUnderlyingErrorKey: error}];
return 0;
}
} else {
NSError *error = nil;
[interface launch];
[interface waitUntilExit];
if (0 != [interface terminationStatus]) {
*outError = [NSError errorWithDomain:@"interface"
code:-1
userInfo:@{NSUnderlyingErrorKey: error}];
return 0;
}
NSError *error = nil;
[interface launch];
[interface waitUntilExit];
if (0 != [interface terminationStatus]) {
*outError = [NSError errorWithDomain:@"interface"
code:-1
userInfo:@{NSUnderlyingErrorKey: error}];
return 0;
}
NSFileHandle * fh = [standardOut fileHandleForReading];