1 /* abandon.c - shell backend abandon function */
4 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include <ac/signal.h>
13 #include <ac/socket.h>
14 #include <ac/string.h>
27 struct shellinfo *si = (struct shellinfo *) be->be_private;
32 /* no abandon command defined - just kill the process handling it */
33 if ( si->si_abandon == NULL ) {
34 ldap_pvt_thread_mutex_lock( &conn->c_mutex );
36 for ( o = conn->c_ops; o != NULL; o = o->o_next ) {
37 if ( o->o_msgid == msgid ) {
38 pid = (pid_t) o->o_private;
43 for ( o = conn->c_pending_ops; o != NULL; o = o->o_next ) {
44 if ( o->o_msgid == msgid ) {
45 pid = (pid_t) o->o_private;
50 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
53 Debug( LDAP_DEBUG_ARGS, "shell killing pid %d\n",
57 Debug( LDAP_DEBUG_ARGS, "shell could not find op %d\n",
63 if ( forkandexec( si->si_abandon, &rfp, &wfp ) == -1 ) {
67 /* write out the request to the abandon process */
68 fprintf( wfp, "ABANDON\n" );
69 fprintf( wfp, "msgid: %d\n", msgid );
70 print_suffixes( wfp, be );
73 /* no result from abandon */