1 /* abandon.c - shell backend abandon function */
4 * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include <ac/socket.h>
13 #include <ac/string.h>
23 struct shellinfo *si = (struct shellinfo *) op->o_bd->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( &op->o_conn->c_mutex );
32 LDAP_STAILQ_FOREACH( o, &op->o_conn->c_ops, o_next ) {
33 if ( o->o_msgid == op->oq_abandon.rs_msgid ) {
34 pid = (pid_t) o->o_private;
38 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
42 Debug( LDAP_DEBUG_ARGS, "shell could not find op %d\n", op->oq_abandon.rs_msgid, 0, 0 );
46 if ( forkandexec( si->si_abandon, &rfp, &wfp ) == -1 ) {
50 /* write out the request to the abandon process */
51 fprintf( wfp, "ABANDON\n" );
52 fprintf( wfp, "msgid: %d\n", op->oq_abandon.rs_msgid );
53 print_suffixes( wfp, op->o_bd );
54 fprintf( wfp, "pid: %ld\n", (long) pid );
57 /* no result from abandon */