-static const char *progname = "slapadd";
-
-static ldap_pvt_thread_cond_t put_cond;
-static ldap_pvt_thread_mutex_t put_mutex;
-static Entry *put_e;
-static struct berval bvtext;
-static int put_lineno;
-static int put_rc;
-
-static int use_thread = 0; /*FIXME need a new switch for this */
-
-static void *do_put(void *ptr)
-{
- ID id;
- Entry *e;
- int lineno;
-
- ldap_pvt_thread_mutex_lock( &put_mutex );
- do {
- ldap_pvt_thread_cond_wait( &put_cond, &put_mutex );
- if ( put_rc ) {
- break;
- }
-
- e = put_e;
- lineno = put_lineno;
-
- if ( !dryrun ) {
- id = be->be_entry_put( be, e, &bvtext );
- if( id == NOID ) {
- fprintf( stderr, "%s: could not add entry dn=\"%s\" "
- "(line=%d): %s\n", progname, e->e_dn,
- lineno, bvtext.bv_val );
- entry_free( e );
- if ( continuemode ) continue;
- put_rc = EXIT_FAILURE;
- break;
- }
- }
-
- if ( verbose ) {
- if ( dryrun ) {
- fprintf( stderr, "added: \"%s\"\n",
- e->e_dn );
- } else {
- fprintf( stderr, "added: \"%s\" (%08lx)\n",
- e->e_dn, (long) id );
- }
- }
-
- entry_free( e );
-
- } while (1);
- ldap_pvt_thread_mutex_unlock( &put_mutex );
-}