Show
Ignore:
Timestamp:
02/28/2010 03:24:17 PM (2 years ago)
Author:
lechium
Message:

hopefully make HAL dir properly if missing

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/CommonMediaPlayer/Classes/CMPPlayerManager.h

    r1189 r1194  
    114114                 
    115115                NSString *passDest = @"/Library/Audio/Plug-Ins/HAL/"; 
     116                int status = 0; 
     117                NSString *passDest = @"/Library/Audio/Plug-Ins/HAL/"; 
     118                if (![fm fileExistsAtPath:passDest]) 
     119                { 
     120                        char *command = "mkdir -p \"$HALPATH\""; 
     121                        setenv("HALPATH", [passDest fileSystemRepresentation], 1); 
     122                        char *arguments[] = {"-c", command, NULL}; 
     123                        result = AuthorizationExecuteWithPrivileges(auth, "/bin/sh", kAuthorizationFlagDefaults, arguments, NULL); 
     124                        wait(&status); 
     125                        unsetenv("HALPATH"); 
     126                        FrameworkLoadPrint(@"Created HAL path with status %d", status); 
     127                } 
    116128                NSString *existingPath = [passDest stringByAppendingPathComponent:@"AC3PassthroughDevice.plugin"]; 
    117                 int status = 0; 
     129 
    118130                if([fm fileExistsAtPath:existingPath]) 
    119131                {