From af77c232f57dc70c472e10828ae121c4cda50e39 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 25 Oct 1998 00:35:35 +0000 Subject: [PATCH] Found the really, really stupid bug. The SAFEMEMCPY macro in string.h was hosed for memmove/memcpy cases. --- clients/gopher/go500.c | 12 +++++------ clients/gopher/go500gw.c | 10 ++++----- clients/rcpt500/query.c | 2 +- clients/ud/auth.c | 3 ++- clients/ud/edit.c | 11 +++++----- clients/ud/group.c | 4 ++-- clients/ud/mod.c | 9 ++++---- clients/ud/print.c | 5 +++-- include/ac/string.h | 24 +++++++++++---------- include/lutil_sha1.h | 2 +- libraries/libldap/os-ip.c | 2 +- libraries/libldap/sort.c | 6 +++--- servers/slapd/back-ldbm/bind.c | 8 +++++-- servers/slapd/connection.c | 4 ++-- servers/slapd/daemon.c | 28 ++++++++++++------------- servers/slapd/main.c | 4 ++-- servers/slapd/tools/ldbmtest.c | 2 +- servers/slurpd/admin.c | 4 ++-- servers/slurpd/fm.c | 38 +++++++++++++++++----------------- servers/slurpd/main.c | 4 ++-- servers/slurpd/replica.c | 4 ++-- servers/slurpd/ri.c | 8 +++---- 22 files changed, 101 insertions(+), 93 deletions(-) diff --git a/clients/gopher/go500.c b/clients/gopher/go500.c index 792b45a56e..6a8a70c528 100644 --- a/clients/gopher/go500.c +++ b/clients/gopher/go500.c @@ -13,13 +13,13 @@ #include "portable.h" #include -#include -#include -#include -#include +#include +#include #include +#include #include +#include #include #include @@ -176,7 +176,7 @@ char **argv; s = set_socket( port ); /* arrange to reap children */ - (void) signal( SIGCHLD, (void *) wait4child ); + (void) SIGNAL( SIGCHLD, wait4child ); } else { myport = GO500_PORT; @@ -315,7 +315,7 @@ wait4child() ; /* NULL */ #endif - (void) signal( SIGCHLD, (void *) wait4child ); + (void) SIGNAL( SIGCHLD, wait4child ); } static diff --git a/clients/gopher/go500gw.c b/clients/gopher/go500gw.c index 2260d6061a..4600d5af89 100644 --- a/clients/gopher/go500gw.c +++ b/clients/gopher/go500gw.c @@ -13,13 +13,13 @@ #include "portable.h" #include -#include -#include -#include +#include +#include #include #include #include +#include #include #include @@ -198,7 +198,7 @@ char **argv; s = set_socket( port ); /* arrange to reap children */ - (void) signal( SIGCHLD, (void *) wait4child ); + (void) SIGNAL( SIGCHLD, wait4child ); } if ( inetd ) { @@ -339,7 +339,7 @@ wait4child() ; /* NULL */ #endif - (void) signal( SIGCHLD, (void *) wait4child ); + (void) SIGNAL( SIGCHLD, wait4child ); } static do_queries( s ) diff --git a/clients/rcpt500/query.c b/clients/rcpt500/query.c index 65c57df2d3..85b0f5b5f8 100644 --- a/clients/rcpt500/query.c +++ b/clients/rcpt500/query.c @@ -322,7 +322,7 @@ do_read( ldp, dn, reply, tmpll ) rc = ldap_entry2text_search( ldp, dn, searchbase, NULLMSG, tmpll, - defattrs, defvals, (void *)append_text, (void *)reply, "\n", + defattrs, defvals, append_text, (void *)reply, "\n", rdncount, LDAP_DISP_OPT_DOSEARCHACTIONS ); return( rc ); diff --git a/clients/ud/auth.c b/clients/ud/auth.c index 2f64d81c66..8f14aa7a2f 100644 --- a/clients/ud/auth.c +++ b/clients/ud/auth.c @@ -40,6 +40,8 @@ static int kinit(); static int valid_tgt(); #endif +static void set_bound_dn(); + auth(who, implicit) char *who; int implicit; @@ -68,7 +70,6 @@ int implicit; extern void printbase(); /* used to pretty-print a base */ extern int bind_status; extern void Free(); - static void set_bound_dn(); #ifdef DEBUG if (debug & D_TRACE) diff --git a/clients/ud/edit.c b/clients/ud/edit.c index 01dc1e0417..f8a094361a 100644 --- a/clients/ud/edit.c +++ b/clients/ud/edit.c @@ -33,6 +33,12 @@ extern LDAP *ld; extern LDAPMessage *find(); +static int load_editor(); +static int modifiable(); +static int print_attrs_and_values(); +static int ovalues(); +static int write_entry(); + static char *entry_temp_file; #ifdef DEBUG @@ -46,8 +52,6 @@ char *who; char *dn, **rdns; /* distinguished name */ char name[MED_BUF_SIZE]; /* entry to modify */ extern int bind_status; - static int load_editor(); - static int write_entry(); #ifdef DEBUG if (debug & D_TRACE) @@ -114,7 +118,6 @@ static load_editor() static char template[MED_BUF_SIZE]; extern char * mktemp(); extern int isgroup(), fatal(); - static int print_attrs_and_values(); int pid; int status; int rc; @@ -195,7 +198,6 @@ FILE *fp; struct attribute attrs[]; short flag; { - static int modifiable(); register int i, j; for (i = 0; attrs[i].quipu_name != NULL; i++) { @@ -242,7 +244,6 @@ static write_entry() LDAPMod *mods[MAX_ATTRS + 1]; LDAPMod *modp = NULL; - static int ovalues(); extern char * code_to_str(); extern void free_mod_struct(); diff --git a/clients/ud/group.c b/clients/ud/group.c index 5e3d2a0263..eee8a6b621 100644 --- a/clients/ud/group.c +++ b/clients/ud/group.c @@ -37,6 +37,8 @@ extern LDAP *ld; extern void Free(); +static char * bind_and_fetch(); + void add_group(name) char *name; { @@ -209,7 +211,6 @@ void remove_group(name) char *name; { char *dn, tmp[BUFSIZ]; - static char * bind_and_fetch(); #ifdef DEBUG if (debug & D_TRACE) { @@ -260,7 +261,6 @@ char *name; char *values[2], *group_name; LDAPMod mod, *mods[2]; static char *actions[] = { "join", "resign from", NULL }; - static char * bind_and_fetch(); #ifdef DEBUG if (debug & D_TRACE) { diff --git a/clients/ud/mod.c b/clients/ud/mod.c index a5e5369ca9..c946bb8045 100644 --- a/clients/ud/mod.c +++ b/clients/ud/mod.c @@ -27,6 +27,10 @@ extern int verbose; extern LDAP *ld; extern LDAPMessage *find(); +extern void * Malloc(); + +static char * get_URL(); +static int check_URL(); #ifdef DEBUG extern int debug; @@ -382,9 +386,6 @@ char *id, *prompt; static char line[LINE_SIZE]; /* raw line from user */ static char buffer[MAX_DESC_LINES * LINE_SIZE]; /* holds ALL of the lines we get */ - extern void * Malloc(); - static char * get_URL(); - #ifdef DEBUG if (debug & D_TRACE) printf("->get_value(%s, %s)\n", id, prompt); @@ -754,8 +755,6 @@ int group; static char * get_URL() { char *rvalue, label[MED_BUF_SIZE], url[MED_BUF_SIZE]; - static int check_URL(); - extern void * Malloc(); if (verbose) { printf(" First, enter the URL. (Example: http://www.us.itd.umich.edu/users/).\n"); diff --git a/clients/ud/print.c b/clients/ud/print.c index 5b7cb87910..5ff0f6b2d9 100644 --- a/clients/ud/print.c +++ b/clients/ud/print.c @@ -34,6 +34,9 @@ extern void * Malloc(); extern void Free(); extern char * my_ldap_dn2ufn(); +static char *time2text(); +static long gtime(); + /* * When displaying entries, display only these attributes, and in this * order. @@ -193,7 +196,6 @@ print_an_entry() char is_a_group, **order; char *sub_list[MAX_VALUES], buf[SMALL_BUF_SIZE]; extern int col_size, isaurl(), isadn(); - static char *time2text(); #ifdef DEBUG if (debug & D_TRACE) @@ -557,7 +559,6 @@ time2text( char *ldtimestr, int dateonly ) struct tm t; char *p, *timestr, zone, *fmterr = "badly formatted time"; time_t gmttime; - static long gtime(); memset( (char *)&t, 0, sizeof( struct tm )); if ( strlen( ldtimestr ) < 13 ) { diff --git a/include/ac/string.h b/include/ac/string.h index 2a923e9356..147976fc68 100644 --- a/include/ac/string.h +++ b/include/ac/string.h @@ -13,20 +13,22 @@ char *strchr (), *strrchr (); # ifndef HAVE_MEMCPY -# define memcpy(d, s, n) bcopy ((s), (d), (n)) -# define memmove(d, s, n) bcopy ((s), (d), (n)) +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif -#if defined( HAVE_MEMMOVE ) -#define SAFEMEMCPY( d, s, n ) memmove((s), (d), (n)) -#elif defined( HAVE_BCOPY ) -#define SAFEMEMCPY( d, s, n ) bcopy((s), (d), (n)) -#elif defined( MACOS ) -#define SAFEMEMCPY( d, s, n ) BlockMoveData((Ptr)(s), (Ptr)(d), (n)) -#else -/* nothing left but memcpy() */ -#define SAFEMEMCPY( d, s, n ) memcpy((s), (d), (n)) +#ifndef SAFEMEMCPY +# if defined( HAVE_MEMMOVE ) +# define SAFEMEMCPY( d, s, n ) memmove((d), (s), (n)) +# elif defined( HAVE_BCOPY ) +# define SAFEMEMCPY( d, s, n ) bcopy((s), (d), (n)) +# elif defined( MACOS ) +# define SAFEMEMCPY( d, s, n ) BlockMoveData((Ptr)(s), (Ptr)(d), (n)) +# else + /* nothing left but memcpy() */ +# define SAFEMEMCPY( d, s, n ) memcpy((d), (s), (n)) +# endif #endif #endif /* _AC_STRING_H */ diff --git a/include/lutil_sha1.h b/include/lutil_sha1.h index f4ed0a7538..b20d490305 100644 --- a/include/lutil_sha1.h +++ b/include/lutil_sha1.h @@ -49,4 +49,4 @@ LDAP_F char *ldap_SHA1Data LDAP_END_DECL -#endif _LDAP_SHA1_H_ +#endif /* _LDAP_SHA1_H_ */ diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index e87cb0cb46..d5bd6715bf 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -139,7 +139,7 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, #endif /* notyet */ Debug( LDAP_DEBUG_TRACE, "sd %d connected to: %s\n", - s, inet_ntoa( sin.sin_addr ), 0 ); + s, (char *) inet_ntoa( sin.sin_addr ), 0 ); } return( rc ); diff --git a/libraries/libldap/sort.c b/libraries/libldap/sort.c index 7e90d9fcd6..2ac3c31a81 100644 --- a/libraries/libldap/sort.c +++ b/libraries/libldap/sort.c @@ -79,7 +79,7 @@ ldap_sort_entries( LDAP *ld, LDAPMessage **chain, char *attr, /* NULL => sort by DN */ - int (*cmp)() + int (*cmp) LDAP_P((char *, char *)) ) { int i, count; @@ -113,7 +113,7 @@ ldap_sort_entries( last = e; et_cmp_fn = cmp; - qsort( et, count, sizeof(struct entrything), (void *) et_cmp ); + qsort( et, count, sizeof(struct entrything), et_cmp ); ep = chain; for ( i = 0; i < count; i++ ) { @@ -140,7 +140,7 @@ ldap_sort_values( for ( nel = 0; vals[nel] != NULL; nel++ ) ; /* NULL */ - qsort( vals, nel, sizeof(char *), (void *) cmp ); + qsort( vals, nel, sizeof(char *), cmp ); return( 0 ); } diff --git a/servers/slapd/back-ldbm/bind.c b/servers/slapd/back-ldbm/bind.c index f27872456e..d1224a2dfd 100644 --- a/servers/slapd/back-ldbm/bind.c +++ b/servers/slapd/back-ldbm/bind.c @@ -63,7 +63,9 @@ crypted_value_find( char *userpassword = vals[i]->bv_val + sizeof("{MD5}") - 1; ldap_MD5Init(&MD5context); - ldap_MD5Update(&MD5context, cred->bv_val, strlen(cred->bv_val)); + ldap_MD5Update(&MD5context, + (unsigned char *) cred->bv_val, + strlen(cred->bv_val)); ldap_MD5Final(MD5digest, &MD5context); if (b64_ntop(MD5digest, sizeof(MD5digest), @@ -86,7 +88,9 @@ crypted_value_find( char *userpassword = vals[i]->bv_val + sizeof("{SHA}") - 1; ldap_SHA1Init(&SHA1context); - ldap_SHA1Update(&SHA1context, cred->bv_val, strlen(cred->bv_val)); + ldap_SHA1Update(&SHA1context, + (unsigned char *) cred->bv_val, + strlen(cred->bv_val)); ldap_SHA1Final(SHA1digest, &SHA1context); if (b64_ntop(SHA1digest, sizeof(SHA1digest), diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 661877ffb4..15f2dfd0bd 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -206,7 +206,7 @@ connection_activity( * This is a draft 10 or standard pthreads implementation */ if ( pthread_create( &arg->co_op->o_tid, &attr, - (void *) connection_operation, (void *) arg ) != 0 ) { + connection_operation, (void *) arg ) != 0 ) { Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 ); } else { pthread_mutex_lock( &active_threads_mutex ); @@ -218,7 +218,7 @@ connection_activity( * This is a draft 4 or earlier pthreads implementation */ if ( pthread_create( &arg->co_op->o_tid, attr, - (void *) connection_operation, (void *) arg ) != 0 ) { + connection_operation, (void *) arg ) != 0 ) { Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 ); } else { pthread_mutex_lock( &active_threads_mutex ); diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index d863a6a9c5..b9a11efb70 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -146,15 +146,15 @@ slapd_daemon( * LinuxThreads are implemented using SIGUSR1/USR2, * so we'll use SIGSTKFLT and SIGUNUSED */ - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); - (void) SIGNAL( SIGUNUSED, (void *) set_shutdown ); + (void) SIGNAL( SIGSTKFLT, do_nothing ); + (void) SIGNAL( SIGUNUSED, set_shutdown ); #else /* !linux */ - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); - (void) SIGNAL( SIGUSR2, (void *) set_shutdown ); + (void) SIGNAL( SIGUSR1, do_nothing ); + (void) SIGNAL( SIGUSR2, set_shutdown ); #endif /* !linux */ - (void) SIGNAL( SIGTERM, (void *) set_shutdown ); - (void) SIGNAL( SIGINT, (void *) set_shutdown ); - (void) SIGNAL( SIGHUP, (void *) set_shutdown ); + (void) SIGNAL( SIGTERM, set_shutdown ); + (void) SIGNAL( SIGINT, set_shutdown ); + (void) SIGNAL( SIGHUP, set_shutdown ); Debug( LDAP_DEBUG_ANY, "slapd starting\n", 0, 0, 0 ); #ifdef SLAPD_PIDFILE @@ -420,14 +420,14 @@ set_shutdown() * so we'll use SIGSTKFLT and SIGUNUSED */ pthread_kill( listener_tid, SIGSTKFLT ); - (void) SIGNAL( SIGUNUSED, (void *) set_shutdown ); + (void) SIGNAL( SIGUNUSED, set_shutdown ); #else /* !linux */ pthread_kill( listener_tid, SIGUSR1 ); - (void) SIGNAL( SIGUSR2, (void *) set_shutdown ); + (void) SIGNAL( SIGUSR2, set_shutdown ); #endif /* !linux */ - (void) SIGNAL( SIGTERM, (void *) set_shutdown ); - (void) SIGNAL( SIGINT, (void *) set_shutdown ); - (void) SIGNAL( SIGHUP, (void *) set_shutdown ); + (void) SIGNAL( SIGTERM, set_shutdown ); + (void) SIGNAL( SIGINT, set_shutdown ); + (void) SIGNAL( SIGHUP, set_shutdown ); } static void @@ -439,8 +439,8 @@ do_nothing() * LinuxThreads are implemented using SIGUSR1/USR2, * so we'll use SIGSTKFLT and SIGUNUSED */ - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); + (void) SIGNAL( SIGSTKFLT, do_nothing ); #else /* !linux */ - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); + (void) SIGNAL( SIGUSR1, do_nothing ); #endif /* !linux */ } diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 59fb391b1f..bb4c286703 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -185,7 +185,7 @@ main( argc, argv ) /* POSIX_THREADS or compatible * This is a draft 10 or standard pthreads implementation */ - if ( pthread_create( &listener_tid, &attr, (void *) slapd_daemon, + if ( pthread_create( &listener_tid, &attr, slapd_daemon, (void *) port ) != 0 ) { Debug( LDAP_DEBUG_ANY, "listener pthread_create failed\n", 0, 0, 0 ); @@ -195,7 +195,7 @@ main( argc, argv ) /* * This is a draft 4 or earlier pthreads implementation */ - if ( pthread_create( &listener_tid, attr, (void *) slapd_daemon, + if ( pthread_create( &listener_tid, attr, slapd_daemon, (void *) port ) != 0 ) { Debug( LDAP_DEBUG_ANY, "listener pthread_create failed\n", 0, 0, 0 ); diff --git a/servers/slapd/tools/ldbmtest.c b/servers/slapd/tools/ldbmtest.c index 5be56d64f6..9649eff22b 100644 --- a/servers/slapd/tools/ldbmtest.c +++ b/servers/slapd/tools/ldbmtest.c @@ -474,7 +474,7 @@ get_idlist( fp, data ) p->b_nids = i; } - qsort( (void *) p->b_ids, i, sizeof(ID), (void *) dnid_cmp ); + qsort( (void *) p->b_ids, i, sizeof(ID), dnid_cmp ); } data->dptr = (char *) p; diff --git a/servers/slurpd/admin.c b/servers/slurpd/admin.c index af28544d18..5af8d53cce 100644 --- a/servers/slurpd/admin.c +++ b/servers/slurpd/admin.c @@ -35,9 +35,9 @@ * slurpd receives a USR2 signal, it will dump its replication * queue to the disk file given by SLURPD_DUMPFILE. */ -void +RETSIGTYPE do_admin() { sglob->rq->rq_dump( sglob->rq ); - (void) SIGNAL( SIGUSR2, (void *) do_admin ); + (void) SIGNAL( SIGUSR2, do_admin ); } diff --git a/servers/slurpd/fm.c b/servers/slurpd/fm.c index 8397836533..2aed9e602e 100644 --- a/servers/slurpd/fm.c +++ b/servers/slurpd/fm.c @@ -28,7 +28,7 @@ /* * Externs */ -extern void do_admin LDAP_P((void)); +extern RETSIGTYPE do_admin LDAP_P((int)); extern int file_nonempty LDAP_P(( char * )); extern int acquire_lock LDAP_P((char *, FILE **, FILE ** )); extern int relinquish_lock LDAP_P((char *, FILE *, FILE * )); @@ -38,8 +38,8 @@ extern int relinquish_lock LDAP_P((char *, FILE *, FILE * )); */ static char *get_record LDAP_P(( FILE * )); static void populate_queue LDAP_P(( char *f )); -static void set_shutdown LDAP_P((void)); -void do_nothing LDAP_P((void)); +static RETSIGTYPE set_shutdown LDAP_P((int)); +RETSIGTYPE do_nothing LDAP_P((int)); /* @@ -64,15 +64,15 @@ fm( * (not yet implemented). */ #ifdef HAVE_LINUX_THREADS - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); - (void) SIGNAL( SIGUNUSED, (void *) do_admin ); + (void) SIGNAL( SIGSTKFLT, do_nothing ); + (void) SIGNAL( SIGUNUSED, do_admin ); #else - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); - (void) SIGNAL( SIGUSR2, (void *) do_admin ); + (void) SIGNAL( SIGUSR1, do_nothing ); + (void) SIGNAL( SIGUSR2, do_admin ); #endif - (void) SIGNAL( SIGTERM, (void *) set_shutdown ); - (void) SIGNAL( SIGINT, (void *) set_shutdown ); - (void) SIGNAL( SIGHUP, (void *) set_shutdown ); + (void) SIGNAL( SIGTERM, set_shutdown ); + (void) SIGNAL( SIGINT, set_shutdown ); + (void) SIGNAL( SIGHUP, set_shutdown ); if ( sglob->one_shot_mode ) { if ( file_nonempty( sglob->slapd_replogfile )) { @@ -141,8 +141,8 @@ fm( /* * Set a global flag which signals that we're shutting down. */ -static void -set_shutdown() +static RETSIGTYPE +set_shutdown(int x) { int i; @@ -158,9 +158,9 @@ set_shutdown() (sglob->replicas[ i ])->ri_wake( sglob->replicas[ i ]); } sglob->rq->rq_unlock( sglob->rq ); /* unlock queue */ - (void) SIGNAL( SIGTERM, (void *) set_shutdown ); /* reinstall handlers */ - (void) SIGNAL( SIGINT, (void *) set_shutdown ); - (void) SIGNAL( SIGHUP, (void *) set_shutdown ); + (void) SIGNAL( SIGTERM, set_shutdown ); /* reinstall handlers */ + (void) SIGNAL( SIGINT, set_shutdown ); + (void) SIGNAL( SIGHUP, set_shutdown ); } @@ -169,13 +169,13 @@ set_shutdown() /* * A do-nothing signal handler. */ -void -do_nothing() +RETSIGTYPE +do_nothing(int i) { #ifdef HAVE_LINUX_THREADS - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); + (void) SIGNAL( SIGSTKFLT, do_nothing ); #else - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); + (void) SIGNAL( SIGUSR1, do_nothing ); #endif } diff --git a/servers/slurpd/main.c b/servers/slurpd/main.c index 85383dd9fc..d780ed3038 100644 --- a/servers/slurpd/main.c +++ b/servers/slurpd/main.c @@ -128,7 +128,7 @@ main( /* POSIX_THREADS or compatible * This is a draft 10 or standard pthreads implementation */ - if ( pthread_create( &(sglob->fm_tid), &attr, (void *) fm, (void *) NULL ) + if ( pthread_create( &(sglob->fm_tid), &attr, fm, (void *) NULL ) != 0 ) { Debug( LDAP_DEBUG_ANY, "file manager pthread_create failed\n", 0, 0, 0 ); @@ -139,7 +139,7 @@ main( /* * This is a draft 4 or earlier pthreads implementation */ - if ( pthread_create( &(sglob->fm_tid), attr, (void *) fm, (void *) NULL ) + if ( pthread_create( &(sglob->fm_tid), attr, fm, (void *) NULL ) != 0 ) { Debug( LDAP_DEBUG_ANY, "file manager pthread_create failed\n", 0, 0, 0 ); diff --git a/servers/slurpd/replica.c b/servers/slurpd/replica.c index 9652827950..7ce0c54f2b 100644 --- a/servers/slurpd/replica.c +++ b/servers/slurpd/replica.c @@ -67,7 +67,7 @@ start_replica_thread( /* POSIX_THREADS or compatible * This is a draft 10 or standard pthreads implementation */ - if ( pthread_create( &(ri->ri_tid), &attr, (void *) replicate, + if ( pthread_create( &(ri->ri_tid), &attr, replicate, (void *) ri ) != 0 ) { Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" pthread_create failed\n", ri->ri_hostname, ri->ri_port, 0 ); @@ -78,7 +78,7 @@ start_replica_thread( /* * This is a draft 4 or earlier pthreads implementation */ - if ( pthread_create( &(ri->ri_tid), attr, (void *) replicate, + if ( pthread_create( &(ri->ri_tid), attr, replicate, (void *) ri ) != 0 ) { Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" pthread_create failed\n", ri->ri_hostname, ri->ri_port, 0 ); diff --git a/servers/slurpd/ri.c b/servers/slurpd/ri.c index 0560a49e79..4356c85cee 100644 --- a/servers/slurpd/ri.c +++ b/servers/slurpd/ri.c @@ -51,9 +51,9 @@ Ri_process( char *errmsg; #ifdef HAVE_LINUX_THREADS - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); + (void) SIGNAL( SIGSTKFLT, do_nothing ); #else - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); + (void) SIGNAL( SIGUSR1, do_nothing ); #endif (void) SIGNAL( SIGPIPE, SIG_IGN ); if ( ri == NULL ) { @@ -153,10 +153,10 @@ Ri_wake( } #ifdef HAVE_LINUX_THREADS pthread_kill( ri->ri_tid, SIGSTKFLT ); - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); + (void) SIGNAL( SIGSTKFLT, do_nothing ); #else pthread_kill( ri->ri_tid, SIGUSR1 ); - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); + (void) SIGNAL( SIGUSR1, do_nothing ); #endif } -- 2.39.5