Changeset 4476

Show
Ignore:
Timestamp:
02/03/07 01:19:00 (2 years ago)
Author:
morris
Message:

Better check to see if the wired.pid contains a pid to a running "wired" process

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredServer/trunk/WCStatusController.m

    r3950 r4476  
    2727 */ 
    2828 
     29#import "WCDashboardController.h" 
    2930#import "WCSettings.h" 
    3031#import "WCStatusController.h" 
     
    124125- (void)_updatePid { 
    125126        NSString        *pid; 
     127        NSString        *command; 
    126128        BOOL            running; 
    127129         
     
    131133                running = NO; 
    132134        } else { 
    133                 if(kill([pid intValue], 0) == 0 || errno == EPERM) { 
     135                command = [[NSWorkspace sharedWorkspace] commandForProcessIdentifier:[pid unsignedIntValue]]; 
     136                 
     137                if([command isEqualToString:@"wired"]) { 
    134138                        running = YES; 
    135139                } else { 
    136                         [[NSFileManager defaultManager] removeFileAtPath:WCExpandWiredPath(@"wired.pid") handler:NULL]; 
     140                        [[WCDashboardController dashboardController] removeFileAtPath:WCExpandWiredPath(@"wired.pid")]; 
    137141                         
    138142                        running = NO;