1 /* abandon.c - shell backend abandon function */
22 struct shellinfo *si = (struct shellinfo *) be->be_private;
27 /* no abandon command defined - just kill the process handling it */
28 if ( si->si_abandon == NULL ) {
29 ldap_pvt_thread_mutex_lock( &conn->c_mutex );
31 for ( o = conn->c_ops; o != NULL; o = o->o_next ) {
32 if ( o->o_msgid == msgid ) {
33 pid = (pid_t) o->o_private;
38 for ( o = conn->c_pending_ops; o != NULL; o = o->o_next ) {
39 if ( o->o_msgid == msgid ) {
40 pid = (pid_t) o->o_private;
45 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
48 Debug( LDAP_DEBUG_ARGS, "shell killing pid %d\n", pid,
52 Debug( LDAP_DEBUG_ARGS, "shell could not find op %d\n",
58 if ( forkandexec( si->si_abandon, &rfp, &wfp ) == -1 ) {
62 /* write out the request to the abandon process */
63 fprintf( wfp, "ABANDON\n" );
64 fprintf( wfp, "msgid: %d\n", msgid );
65 print_suffixes( wfp, be );
68 /* no result from abandon */