Changeset 5029

Show
Ignore:
Timestamp:
11/01/07 19:25:10 (1 year ago)
Author:
morris
Message:

Wait with WNOHANG

Files:

Legend:

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

    r4611 r5029  
    226226        NSUInteger              i, argc; 
    227227        int                             status; 
     228        pid_t                   pid; 
    228229 
    229230        argc = [arguments count]; 
     
    240241                                                                                         argv, 
    241242                                                                                         &fp); 
    242         wait(&status); 
    243243        free(argv); 
    244244         
     
    249249        } 
    250250         
    251         fileHandle = [[NSFileHandle alloc] initWithFileDescriptor:fileno(fp) closeOnDealloc:YES]; 
    252         data = [fileHandle availableData]; 
    253         [[WCLogController logController] log:[NSString stringWithData:data encoding:NSUTF8StringEncoding]]; 
    254         [fileHandle release]; 
     251        pid = wait3(&status, WNOHANG, NULL); 
     252 
     253        if(pid > 0) { 
     254                fileHandle = [[NSFileHandle alloc] initWithFileDescriptor:fileno(fp) closeOnDealloc:NO]; 
     255                data = [fileHandle availableData]; 
     256                [[WCLogController logController] log:[NSString stringWithData:data encoding:NSUTF8StringEncoding]]; 
     257                [fileHandle release]; 
     258        } 
     259         
     260        fclose(fp); 
    255261         
    256262        return YES; 
  • WiredServer/trunk/WiredServer.xcodeproj/project.pbxproj

    r4744 r5029  
    116116                        remoteGlobalIDString = 8D202CE80486D31800D8A456; 
    117117                        remoteInfo = "Wired Preference Pane"; 
     118                }; 
     119                A5A2A5A80CD4E79C00969CEF /* PBXContainerItemProxy */ = { 
     120                        isa = PBXContainerItemProxy; 
     121                        containerPortal = A5BE6D1C0864B62000DA5C89 /* WiredAdditions.xcodeproj */; 
     122                        proxyType = 2; 
     123                        remoteGlobalIDString = 774897900CC8A63200E95A83; 
     124                        remoteInfo = "Wired Networking"; 
    118125                }; 
    119126                A5BE6D240864B62000DA5C89 /* PBXContainerItemProxy */ = { 
     
    436443                        children = ( 
    437444                                A5BE6D250864B62000DA5C89 /* WiredAdditions.framework */, 
     445                                A5A2A5A90CD4E79C00969CEF /* WiredNetworking.framework */, 
    438446                        ); 
    439447                        name = Products; 
     
    490498                        isa = PBXProject; 
    491499                        buildConfigurationList = A5BE6CFF0864B5A000DA5C89 /* Build configuration list for PBXProject "WiredServer" */; 
     500                        compatibilityVersion = "Xcode 2.4"; 
    492501                        hasScannedForEncodings = 1; 
    493502                        knownRegions = ( 
     
    519528 
    520529/* Begin PBXReferenceProxy section */ 
     530                A5A2A5A90CD4E79C00969CEF /* WiredNetworking.framework */ = { 
     531                        isa = PBXReferenceProxy; 
     532                        fileType = wrapper.framework; 
     533                        path = WiredNetworking.framework; 
     534                        remoteRef = A5A2A5A80CD4E79C00969CEF /* PBXContainerItemProxy */; 
     535                        sourceTree = BUILT_PRODUCTS_DIR; 
     536                }; 
    521537                A5BE6D250864B62000DA5C89 /* WiredAdditions.framework */ = { 
    522538                        isa = PBXReferenceProxy;