mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
Remove configure's wait3 test as we don't care about the rusage.
Rewrite all child waits to use wait4 (for consistency only).
This commit is contained in:
parent
7c2bcc4e12
commit
4863d98084
@ -325,10 +325,10 @@ wait4child( int sig )
|
||||
if ( debug ) printf( "parent: catching child status\n" );
|
||||
|
||||
#ifdef HAVE_WAITPID
|
||||
while (waitpid ((pid_t) -1, 0, WAIT_FLAGS) > 0)
|
||||
while (waitpid ((pid_t) -1, (int *) NULL, WAIT_FLAGS) > 0)
|
||||
; /* NULL */
|
||||
#else
|
||||
while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 )
|
||||
while ( wait4((pid_t) -1, &status, WAIT_FLAGS, 0 ) > 0 )
|
||||
; /* NULL */
|
||||
#endif
|
||||
|
||||
|
@ -352,10 +352,10 @@ wait4child( int sig )
|
||||
if ( debug ) printf( "parent: catching child status\n" );
|
||||
|
||||
#ifdef HAVE_WAITPID
|
||||
while (waitpid ((pid_t) -1, NULL, WAIT_FLAGS) > 0)
|
||||
while (waitpid ((pid_t) -1, (int *) NULL, WAIT_FLAGS) > 0)
|
||||
; /* NULL */
|
||||
#else
|
||||
while (wait3( &status, WAIT_FLAGS, 0 ) > 0 )
|
||||
while (wait4( (pid_t) -1, &status, WAIT_FLAGS, 0 ) > 0 )
|
||||
; /* NULL */
|
||||
#endif
|
||||
|
||||
|
103
configure
vendored
103
configure
vendored
@ -8338,69 +8338,6 @@ done
|
||||
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
|
||||
echo "configure:8343: checking for wait3 that fills in rusage" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test "$cross_compiling" = yes; then
|
||||
ac_cv_func_wait3_rusage=no
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8351 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <stdio.h>
|
||||
/* HP-UX has wait3 but does not fill in rusage at all. */
|
||||
main() {
|
||||
struct rusage r;
|
||||
int i;
|
||||
/* Use a field that we can force nonzero --
|
||||
voluntary context switches.
|
||||
For systems like NeXT and OSF/1 that don't set it,
|
||||
also use the system CPU time. And page faults (I/O) for Linux. */
|
||||
r.ru_nvcsw = 0;
|
||||
r.ru_stime.tv_sec = 0;
|
||||
r.ru_stime.tv_usec = 0;
|
||||
r.ru_majflt = r.ru_minflt = 0;
|
||||
switch (fork()) {
|
||||
case 0: /* Child. */
|
||||
sleep(1); /* Give up the CPU. */
|
||||
_exit(0);
|
||||
case -1: _exit(0); /* What can we do? */
|
||||
default: /* Parent. */
|
||||
wait3(&i, 0, &r);
|
||||
sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines. */
|
||||
exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
|
||||
&& r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
|
||||
}
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:8382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_func_wait3_rusage=yes
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -fr conftest*
|
||||
ac_cv_func_wait3_rusage=no
|
||||
fi
|
||||
rm -fr conftest*
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6
|
||||
if test $ac_cv_func_wait3_rusage = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define HAVE_WAIT3 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
for ac_func in \
|
||||
bcopy \
|
||||
flock \
|
||||
@ -8434,12 +8371,12 @@ for ac_func in \
|
||||
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:8438: checking for $ac_func" >&5
|
||||
echo "configure:8375: checking for $ac_func" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8443 "configure"
|
||||
#line 8380 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
@ -8462,7 +8399,7 @@ $ac_func();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:8403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
@ -8496,12 +8433,12 @@ for ac_func in \
|
||||
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:8500: checking for $ac_func" >&5
|
||||
echo "configure:8437: checking for $ac_func" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8505 "configure"
|
||||
#line 8442 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
@ -8524,7 +8461,7 @@ $ac_func();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:8465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
@ -8551,19 +8488,19 @@ done
|
||||
|
||||
if test "$ac_cv_func_ctime_r" = yes ; then
|
||||
echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
|
||||
echo "configure:8555: checking number of arguments of ctime_r" >&5
|
||||
echo "configure:8492: checking number of arguments of ctime_r" >&5
|
||||
if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8560 "configure"
|
||||
#line 8497 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <time.h>
|
||||
int main() {
|
||||
time_t ti; char *buffer; ctime_r(&ti,buffer,32);
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:8504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ol_cv_func_ctime_r_nargs=3
|
||||
else
|
||||
@ -8575,7 +8512,7 @@ fi
|
||||
rm -f conftest*
|
||||
if test $ol_cv_func_ctime_r_nargs = 0 ; then
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8579 "configure"
|
||||
#line 8516 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <time.h>
|
||||
int main() {
|
||||
@ -8583,7 +8520,7 @@ time_t ti; char *buffer;
|
||||
ctime_r(&ti,buffer);
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:8524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ol_cv_func_ctime_r_nargs=2
|
||||
else
|
||||
@ -8632,12 +8569,12 @@ fi
|
||||
for ac_func in getopt tempnam
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:8636: checking for $ac_func" >&5
|
||||
echo "configure:8573: checking for $ac_func" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8641 "configure"
|
||||
#line 8578 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
@ -8660,7 +8597,7 @@ $ac_func();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:8601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
@ -8690,13 +8627,13 @@ done
|
||||
# Check Configuration
|
||||
|
||||
echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
|
||||
echo "configure:8694: checking declaration of sys_errlist" >&5
|
||||
echo "configure:8631: checking declaration of sys_errlist" >&5
|
||||
if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8700 "configure"
|
||||
#line 8637 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#include <stdio.h>
|
||||
@ -8706,7 +8643,7 @@ int main() {
|
||||
char *c = (char *) *sys_errlist
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:8647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ol_cv_dcl_sys_errlist=yes
|
||||
else
|
||||
@ -8727,20 +8664,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then
|
||||
EOF
|
||||
|
||||
echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
|
||||
echo "configure:8731: checking existence of sys_errlist" >&5
|
||||
echo "configure:8668: checking existence of sys_errlist" >&5
|
||||
if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8737 "configure"
|
||||
#line 8674 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <errno.h>
|
||||
int main() {
|
||||
char *c = (char *) *sys_errlist
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:8744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:8681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
ol_cv_have_sys_errlist=yes
|
||||
else
|
||||
|
@ -1278,8 +1278,6 @@ if test $ac_cv_func_vprintf = yes ; then
|
||||
AC_CHECK_FUNCS(vsnprintf vsprintf)
|
||||
fi
|
||||
|
||||
AC_FUNC_WAIT3
|
||||
|
||||
AC_CHECK_FUNCS( \
|
||||
bcopy \
|
||||
flock \
|
||||
|
@ -47,9 +47,6 @@
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
#undef HAVE_WAIT3
|
||||
|
||||
/* Define if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
|
@ -653,10 +653,10 @@ wait4child( int sig )
|
||||
Debug( LDAP_DEBUG_TRACE, "parent: catching child status\n", 0, 0, 0 );
|
||||
|
||||
#ifdef HAVE_WAITPID
|
||||
while( waitpid( (pid_t) -1, NULL, WAIT_FLAGS ) > 0 )
|
||||
while( waitpid( (pid_t) -1, (int *) NULL, WAIT_FLAGS ) > 0 )
|
||||
; /* NULL */
|
||||
#else
|
||||
while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 )
|
||||
while ( wait4( (pid_t) -1, &status, WAIT_FLAGS, 0 ) > 0 )
|
||||
; /* NULL */
|
||||
#endif
|
||||
|
||||
|
@ -537,7 +537,7 @@ edit_entry( char c, Datum *data )
|
||||
#ifdef HAVE_WAITPID
|
||||
if ( waitpid( (pid_t) -1, NULL, WAIT_FLAGS ) < 0 ) {
|
||||
#else
|
||||
if ( wait3( &status, WAIT_FLAGS, 0 ) < 0 ) {
|
||||
if ( wait4( (pid_t) -1, &status, WAIT_FLAGS, 0 ) < 0 ) {
|
||||
#endif
|
||||
perror( "wait" );
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user