]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-shell/abandon.c
Mem context tweaks for bdb_dn2idl
[openldap] / servers / slapd / back-shell / abandon.c
index 3f0f6ed28d998aa9f2d8c0ad6e7d77c9763f3553..12f7a74eaeb86223ae2c6cc5fe8bf5bc38fbb823 100644 (file)
@@ -1,7 +1,7 @@
 /* abandon.c - shell backend abandon function */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
 
 int
 shell_back_abandon(
-    Backend    *be,
-    Connection *conn,
     Operation  *op,
-    int                msgid
-)
+    SlapReply  *rs )
 {
-       struct shellinfo        *si = (struct shellinfo *) be->be_private;
+       struct shellinfo        *si = (struct shellinfo *) op->o_bd->be_private;
        FILE                    *rfp, *wfp;
        pid_t                   pid;
        Operation               *o;
 
        /* no abandon command defined - just kill the process handling it */
-       if ( IS_NULLCMD( si->si_abandon ) ) {
-               ldap_pvt_thread_mutex_lock( &conn->c_mutex );
+       if ( si->si_abandon == NULL ) {
+               ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
                pid = -1;
-               LDAP_STAILQ_FOREACH( o, &conn->c_ops, o_next ) {
-                       if ( o->o_msgid == msgid ) {
+               LDAP_STAILQ_FOREACH( o, &op->o_conn->c_ops, o_next ) {
+                       if ( o->o_msgid == op->oq_abandon.rs_msgid ) {
                                pid = (pid_t) o->o_private;
                                break;
                        }
                }
-               ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
+               ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
        }
 
        if ( pid == -1 ) {
-               Debug( LDAP_DEBUG_ARGS, "shell could not find op %d\n", msgid, 0, 0 );
+               Debug( LDAP_DEBUG_ARGS, "shell could not find op %d\n", op->oq_abandon.rs_msgid, 0, 0 );
                return 0;
        }
 
@@ -52,8 +49,8 @@ shell_back_abandon(
 
        /* write out the request to the abandon process */
        fprintf( wfp, "ABANDON\n" );
-       fprintf( wfp, "msgid: %d\n", msgid );
-       print_suffixes( wfp, be );
+       fprintf( wfp, "msgid: %d\n", op->oq_abandon.rs_msgid );
+       print_suffixes( wfp, op->o_bd );
        fprintf( wfp, "pid: %ld\n", (long) pid );
        fclose( wfp );