Commit 5f285093 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

detect write() and use HAVE_WRITE instead of

  !defined( DOS ) && !defined( MACOS )
Add detection for read & recv/send for later use.
parent dcf9209a
......@@ -11684,6 +11684,7 @@ for ac_func in \
memcpy \
memmove \
mkstemp \
read \
recv \
recvfrom \
setpwfile \
......@@ -11707,15 +11708,18 @@ for ac_func in \
sysconf \
waitpid \
wait4 \
write \
send \
sendto \
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:11714: checking for $ac_func" >&5
echo "configure:11718: 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 11719 "configure"
#line 11723 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
......@@ -11738,7 +11742,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:11742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:11746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
......@@ -11766,12 +11770,12 @@ done
for ac_func in getopt tempnam
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:11770: checking for $ac_func" >&5
echo "configure:11774: 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 11775 "configure"
#line 11779 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
......@@ -11794,7 +11798,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:11798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:11802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
......@@ -11824,13 +11828,13 @@ done
# Check Configuration
echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
echo "configure:11828: checking declaration of sys_errlist" >&5
echo "configure:11832: 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 11834 "configure"
#line 11838 "configure"
#include "confdefs.h"
#include <stdio.h>
......@@ -11840,7 +11844,7 @@ int main() {
char *c = (char *) *sys_errlist
; return 0; }
EOF
if { (eval echo configure:11844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:11848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ol_cv_dcl_sys_errlist=yes
else
......@@ -11860,20 +11864,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:11864: checking existence of sys_errlist" >&5
echo "configure:11868: 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 11870 "configure"
#line 11874 "configure"
#include "confdefs.h"
#include <errno.h>
int main() {
char *c = (char *) *sys_errlist
; return 0; }
EOF
if { (eval echo configure:11877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:11881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ol_cv_have_sys_errlist=yes
else
......
......@@ -1748,6 +1748,7 @@ AC_CHECK_FUNCS( \
memcpy \
memmove \
mkstemp \
read \
recv \
recvfrom \
setpwfile \
......@@ -1771,6 +1772,9 @@ AC_CHECK_FUNCS( \
sysconf \
waitpid \
wait4 \
write \
send \
sendto \
)
dnl We actually may need to replace more than this.
......
......@@ -332,6 +332,9 @@
/* Define if you have the pthread_yield function. */
#undef HAVE_PTHREAD_YIELD
/* Define if you have the read function. */
#undef HAVE_READ
/* Define if you have the recv function. */
#undef HAVE_RECV
......@@ -344,6 +347,12 @@
/* Define if you have the sched_yield function. */
#undef HAVE_SCHED_YIELD
/* Define if you have the send function. */
#undef HAVE_SEND
/* Define if you have the sendto function. */
#undef HAVE_SENDTO
/* Define if you have the setegid function. */
#undef HAVE_SETEGID
......@@ -425,6 +434,9 @@
/* Define if you have the waitpid function. */
#undef HAVE_WAITPID
/* Define if you have the write function. */
#undef HAVE_WRITE
/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
......
......@@ -236,7 +236,7 @@ ber_flush( Sockbuf *sb, BerElement *ber, int freeit )
ber->ber_rwptr, towrite );
}
#if HAVE_WRITE || (!defined(MACOS) && !(defined(DOS) && !defined(_WIN32)))
#if HAVE_WRITE
if ( sb->sb_options & (LBER_TO_FILE | LBER_TO_FILE_ONLY) ) {
rc = write( sb->sb_fd, ber->ber_rwptr, towrite );
if ( sb->sb_options & LBER_TO_FILE_ONLY ) {
......
Markdown is supported
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