Projects
Browse Source     Search     Timeline     Wiki

Changeset 23557

Show
Ignore:
Timestamp:
2008-03-18 10:47:38 (7 months ago)
Author:
zarzycki@…
Message:

<rdar://problem/5795236> Unix callbacks can delete the underlying control block

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/SULeopard/launchd/src/liblaunch.c

    r23378 r23557  
    148148static void launch_mach_checkin_service(launch_data_t obj, const char *key, void *context); 
    149149 
     150static launch_t in_flight_msg_recv_client; 
    150151static pthread_once_t _lc_once = PTHREAD_ONCE_INIT; 
    151152 
     
    563564launchd_close(launch_t lh, typeof(close) closefunc) 
    564565{ 
     566        if (in_flight_msg_recv_client == lh) { 
     567                in_flight_msg_recv_client = NULL; 
     568        } 
     569 
    565570        if (lh->sendbuf) 
    566571                free(lh->sendbuf); 
     
    10101015                } 
    10111016 
     1017                in_flight_msg_recv_client = lh; 
     1018 
    10121019                cb(rmsg, context); 
     1020 
     1021                /* launchd and only launchd can call launchd_close() as a part of the callback */ 
     1022                if (in_flight_msg_recv_client == NULL) { 
     1023                        r = 0; 
     1024                        break; 
     1025                } 
    10131026 
    10141027                lh->recvlen -= data_offset;