From 0181892175ea60c618a9c919e5f634e41d8b0286 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 26 Jan 1999 04:32:26 +0000 Subject: [PATCH] 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. --- servers/slapd/back-shell/abandon.c | 4 ++-- servers/slapd/back-shell/add.c | 2 +- servers/slapd/back-shell/bind.c | 4 ++-- servers/slapd/back-shell/compare.c | 4 ++-- servers/slapd/back-shell/delete.c | 4 ++-- servers/slapd/back-shell/fork.c | 4 ++-- servers/slapd/back-shell/modify.c | 4 ++-- servers/slapd/back-shell/modrdn.c | 4 ++-- servers/slapd/back-shell/search.c | 4 ++-- servers/slapd/back-shell/unbind.c | 4 ++-- servers/slapd/slap.h | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/servers/slapd/back-shell/abandon.c b/servers/slapd/back-shell/abandon.c index 36e81963a9..fef38c9a47 100644 --- a/servers/slapd/back-shell/abandon.c +++ b/servers/slapd/back-shell/abandon.c @@ -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; } } diff --git a/servers/slapd/back-shell/add.c b/servers/slapd/back-shell/add.c index 5d201fd586..9a6663bb5b 100644 --- a/servers/slapd/back-shell/add.c +++ b/servers/slapd/back-shell/add.c @@ -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 ); diff --git a/servers/slapd/back-shell/bind.c b/servers/slapd/back-shell/bind.c index 025cbe973c..93ef4d869a 100644 --- a/servers/slapd/back-shell/bind.c +++ b/servers/slapd/back-shell/bind.c @@ -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 ); diff --git a/servers/slapd/back-shell/compare.c b/servers/slapd/back-shell/compare.c index 9fd4343a0a..1b724055f5 100644 --- a/servers/slapd/back-shell/compare.c +++ b/servers/slapd/back-shell/compare.c @@ -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 ); diff --git a/servers/slapd/back-shell/delete.c b/servers/slapd/back-shell/delete.c index 2d55fdc429..be989ec9c5 100644 --- a/servers/slapd/back-shell/delete.c +++ b/servers/slapd/back-shell/delete.c @@ -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 ); diff --git a/servers/slapd/back-shell/fork.c b/servers/slapd/back-shell/fork.c index 2c2f9b72f8..7619c36745 100644 --- a/servers/slapd/back-shell/fork.c +++ b/servers/slapd/back-shell/fork.c @@ -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 ); diff --git a/servers/slapd/back-shell/modify.c b/servers/slapd/back-shell/modify.c index 3fee57bff8..178b1eb031 100644 --- a/servers/slapd/back-shell/modify.c +++ b/servers/slapd/back-shell/modify.c @@ -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 ); diff --git a/servers/slapd/back-shell/modrdn.c b/servers/slapd/back-shell/modrdn.c index ad7cc5ad41..36bec9e4bc 100644 --- a/servers/slapd/back-shell/modrdn.c +++ b/servers/slapd/back-shell/modrdn.c @@ -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 ); diff --git a/servers/slapd/back-shell/search.c b/servers/slapd/back-shell/search.c index ded0b2f5fc..dc26be2d08 100644 --- a/servers/slapd/back-shell/search.c +++ b/servers/slapd/back-shell/search.c @@ -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 ); diff --git a/servers/slapd/back-shell/unbind.c b/servers/slapd/back-shell/unbind.c index 84bb05138a..7ad4ba619b 100644 --- a/servers/slapd/back-shell/unbind.c +++ b/servers/slapd/back-shell/unbind.c @@ -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; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 3be752ae24..00a921b856 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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; /* -- 2.39.5