1 /* abandon.c - shell backend abandon function */
10 #include <ac/string.h>
23 struct shellinfo *si = (struct shellinfo *) be->be_private;
28 /* no abandon command defined - just kill the process handling it */
29 if ( si->si_abandon == NULL ) {
30 ldap_pvt_thread_mutex_lock( &conn->c_mutex );
32 for ( o = conn->c_ops; o != NULL; o = o->o_next ) {
33 if ( o->o_msgid == msgid ) {
34 pid = (pid_t) o->o_private;
39 for ( o = conn->c_pending_ops; o != NULL; o = o->o_next ) {
40 if ( o->o_msgid == msgid ) {
41 pid = (pid_t) o->o_private;
46 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
49 Debug( LDAP_DEBUG_ARGS, "shell killing pid %d\n",
53 Debug( LDAP_DEBUG_ARGS, "shell could not find op %d\n",
59 if ( forkandexec( si->si_abandon, &rfp, &wfp ) == -1 ) {
63 /* write out the request to the abandon process */
64 fprintf( wfp, "ABANDON\n" );
65 fprintf( wfp, "msgid: %d\n", msgid );
66 print_suffixes( wfp, be );
69 /* no result from abandon */