Commit 01818921 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Change o_private from int to void*. Use it to hold a pid_t (and hope it fits).

Have forkandexec() return pid_t instead of int.
parent 321354ec
......@@ -21,7 +21,7 @@ shell_back_abandon(
{
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 */
......@@ -30,7 +30,7 @@ shell_back_abandon(
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;
}
}
......
......@@ -28,7 +28,7 @@ shell_back_add(
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 );
......
......@@ -33,8 +33,8 @@ shell_back_bind(
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 );
......
......@@ -28,8 +28,8 @@ shell_back_compare(
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 );
......
......@@ -27,8 +27,8 @@ shell_back_delete(
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 );
......
......@@ -11,7 +11,7 @@
#include "slap.h"
#include "shell.h"
int
pid_t
forkandexec(
char **args,
FILE **rfp,
......@@ -19,7 +19,7 @@ forkandexec(
)
{
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 );
......
......@@ -29,8 +29,8 @@ shell_back_modify(
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 );
......
......@@ -29,8 +29,8 @@ shell_back_modrdn(
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 );
......
......@@ -38,8 +38,8 @@ shell_back_search(
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 );
......
......@@ -26,8 +26,8 @@ shell_back_unbind(
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;
......
......@@ -307,7 +307,7 @@ typedef struct slap_op {
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;
/*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment