]> git.sur5r.net Git - openldap/commitdiff
Change o_private from int to void*. Use it to hold a pid_t (and hope it fits).
authorKurt Zeilenga <kurt@openldap.org>
Tue, 26 Jan 1999 04:32:26 +0000 (04:32 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 26 Jan 1999 04:32:26 +0000 (04:32 +0000)
Have forkandexec() return pid_t instead of int.

servers/slapd/back-shell/abandon.c
servers/slapd/back-shell/add.c
servers/slapd/back-shell/bind.c
servers/slapd/back-shell/compare.c
servers/slapd/back-shell/delete.c
servers/slapd/back-shell/fork.c
servers/slapd/back-shell/modify.c
servers/slapd/back-shell/modrdn.c
servers/slapd/back-shell/search.c
servers/slapd/back-shell/unbind.c
servers/slapd/slap.h

index 36e81963a9826f061f113461cc642b79accd9307..fef38c9a4745d1942bd97c559bb616931ed28d00 100644 (file)
@@ -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;
                        }
                }
index 5d201fd586f8afbc555d102ce5a0a82a05206aca..9a6663bb5bfc94ea65e66a3e9b2fdae2cd2c1277 100644 (file)
@@ -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 );
index 025cbe973c2bc4ae2e1b3dc310534cac542d9cff..93ef4d869a177b225d16d01a2c55f7636bb99157 100644 (file)
@@ -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 );
index 9fd4343a0a083aa5e77464ac055ed4fce00231dc..1b724055f5833368f5b9c93a8156a15f3b1425b6 100644 (file)
@@ -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 );
index 2d55fdc429fc8dbbd4c36cc673ce114c9b12fdcb..be989ec9c5d6759da1dfea7a63c817a91e72e234 100644 (file)
@@ -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 );
index 2c2f9b72f889c1d44fb8628a5b82a4a894c48494..7619c367457656ad9856aaeaa38a4ad288c8ea67 100644 (file)
@@ -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 );
index 3fee57bff8f28b5d5374f15985accaba2b539399..178b1eb031b599d62b50c9dc54ce0d2c5eef2a8c 100644 (file)
@@ -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 );
index ad7cc5ad4123b6c2001adb22cb9041996f180542..36bec9e4bc21bd83e15df0d950aceaf78f046f22 100644 (file)
@@ -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 );
index ded0b2f5fcc2851f73d5c8d503ddcbecfb2c015b..dc26be2d08a809e9bb117a81e740df466ac8a210 100644 (file)
@@ -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 );
index 84bb05138ac789ee5a341f08e6a04806543ae561..7ad4ba619b34ed213fed5210b89d520d3cc0defc 100644 (file)
@@ -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;
index 3be752ae24019e67fb4100013c065207f51902ad..00a921b856be8d26ff81563d8bbd608813bfd2e1 100644 (file)
@@ -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;
 
 /*