Have forkandexec() return pid_t instead of int.
{
struct shellinfo *si = (struct shellinfo *) be->be_private;
FILE *rfp, *wfp;
- int pid;
+ pid_t pid;
Operation *o;
/* no abandon command defined - just kill the process handling it */
pid = -1;
for ( o = conn->c_ops; o != NULL; o = o->o_next ) {
if ( o->o_msgid == msgid ) {
- pid = o->o_private;
+ pid = (pid_t) o->o_private;
break;
}
}
return( -1 );
}
- if ( (op->o_private = forkandexec( si->si_add, &rfp, &wfp )) == -1 ) {
+ if ( (op->o_private = (void *) forkandexec( si->si_add, &rfp, &wfp )) == (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
return( -1 );
}
- if ( (op->o_private = forkandexec( si->si_bind, &rfp, &wfp ))
- == -1 ) {
+ if ( (op->o_private = (void *) forkandexec( si->si_bind, &rfp, &wfp ))
+ == (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
return( -1 );
}
- if ( (op->o_private = forkandexec( si->si_compare, &rfp, &wfp ))
- == -1 ) {
+ if ( (op->o_private = (void *) forkandexec( si->si_compare, &rfp, &wfp ))
+ == (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
return( -1 );
}
- if ( (op->o_private = forkandexec( si->si_delete, &rfp, &wfp ))
- == -1 ) {
+ if ( (op->o_private = (void *) forkandexec( si->si_delete, &rfp, &wfp ))
+ == (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
#include "slap.h"
#include "shell.h"
-int
+pid_t
forkandexec(
char **args,
FILE **rfp,
)
{
int p2c[2], c2p[2];
- int pid;
+ pid_t pid;
if ( pipe( p2c ) != 0 || pipe( c2p ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "pipe failed\n", 0, 0, 0 );
return( -1 );
}
- if ( (op->o_private = forkandexec( si->si_modify, &rfp, &wfp ))
- == -1 ) {
+ if ( (op->o_private = (void *) forkandexec( si->si_modify, &rfp, &wfp ))
+ == (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
return( -1 );
}
- if ( (op->o_private = forkandexec( si->si_modrdn, &rfp, &wfp ))
- == -1 ) {
+ if ( (op->o_private = (void *) forkandexec( si->si_modrdn, &rfp, &wfp ))
+ == (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
return( -1 );
}
- if ( (op->o_private = forkandexec( si->si_search, &rfp, &wfp ))
- == -1 ) {
+ if ( (op->o_private = (void *) forkandexec( si->si_search, &rfp, &wfp ))
+ == (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
return;
}
- if ( (op->o_private = forkandexec( si->si_unbind, &rfp, &wfp ))
- == -1 ) {
+ if ( (op->o_private = (void *) forkandexec( si->si_unbind, &rfp, &wfp ))
+ == (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return;
int o_abandon; /* signals op has been abandoned */
pthread_mutex_t o_abandonmutex; /* signals op has been abandoned */
- int o_private; /* anything the backend needs */
+ void *o_private; /* anything the backend needs */
} Operation;
/*