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>
26 struct shellinfo *si = (struct shellinfo *) be->be_private;
31 /* no abandon command defined - just kill the process handling it */
32 if ( si->si_abandon == NULL ) {
33 ldap_pvt_thread_mutex_lock( &conn->c_mutex );
35 LDAP_STAILQ_FOREACH( o, &conn->c_ops, o_next ) {
36 if ( o->o_msgid == msgid ) {
37 pid = (pid_t) o->o_private;
41 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
45 Debug( LDAP_DEBUG_ARGS, "shell could not find op %d\n", msgid, 0, 0 );
49 if ( forkandexec( si->si_abandon, &rfp, &wfp ) == -1 ) {
53 /* write out the request to the abandon process */
54 fprintf( wfp, "ABANDON\n" );
55 fprintf( wfp, "msgid: %d\n", msgid );
56 print_suffixes( wfp, be );
57 fprintf( wfp, "pid: %ld\n", (long) pid );
60 /* no result from abandon */