made ax helper mavericks only

This commit is contained in:
Nick Bolton 2014-03-22 09:07:29 +00:00
parent 303c1892a0
commit 1f9c2ba7e2
1 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#import "AXDatabaseCleaner.h" #import "AXDatabaseCleaner.h"
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <ServiceManagement/ServiceManagement.h> #import <ServiceManagement/ServiceManagement.h>
@ -42,6 +43,8 @@ AXDatabaseCleaner::~AXDatabaseCleaner()
void AXDatabaseCleaner::loadPrivilegeHelper() void AXDatabaseCleaner::loadPrivilegeHelper()
{ {
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 // mavericks
OSStatus status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &d->authRef); OSStatus status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &d->authRef);
if (status != errAuthorizationSuccess) { if (status != errAuthorizationSuccess) {
assert(NO); assert(NO);
@ -75,4 +78,6 @@ void AXDatabaseCleaner::loadPrivilegeHelper()
assert(error != nil); assert(error != nil);
NSLog(@"bless error: domain= %@ / code= %d", [error domain], (int) [error code]); NSLog(@"bless error: domain= %@ / code= %d", [error domain], (int) [error code]);
} }
#endif
} }