From 956d6743264a97107954f2b09d31c298d1ad98d0 Mon Sep 17 00:00:00 2001 From: dtucker Date: Wed, 12 Jul 2006 04:14:31 +0000 Subject: [PATCH] - (dtucker) [configure.ac defines.h] Only define SHUT_RD (and friends) and O_NONBLOCK if they're really needed. Fixes build errors on HP-UX, old Linuxes and probably more. --- ChangeLog | 5 +++++ configure.ac | 13 +++++++++++++ defines.h | 6 +++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d94fb044..1f51779f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20060712 + - (dtucker) [configure.ac defines.h] Only define SHUT_RD (and friends) and O_NONBLOCK + if they're really needed. Fixes build errors on HP-UX, old Linuxes and probably + more. + 20060711 - (dtucker) [configure.ac ssh-keygen.c openbsd-compat/bsd-openpty.c openbsd-compat/daemon.c] Add includes needed by open(2). Conditionally diff --git a/configure.ac b/configure.ac index 9477c6b5..a9725d47 100644 --- a/configure.ac +++ b/configure.ac @@ -1285,6 +1285,19 @@ AC_CHECK_DECL(tcsendbreak, AC_CHECK_DECLS(h_errno, , ,[#include ]) +AC_CHECK_DECLS(SHUT_RD, , ,[#include ]) + +AC_CHECK_DECLS(O_NONBLOCK, , , + [ +#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_FCNTL_H +# include +#endif + ]) + AC_CHECK_FUNCS(setresuid, [ dnl Some platorms have setresuid that isn't implemented, test for this AC_MSG_CHECKING(if setresuid seems to work) diff --git a/defines.h b/defines.h index cc8becd2..cf1e1a2a 100644 --- a/defines.h +++ b/defines.h @@ -30,7 +30,7 @@ /* Constants */ -#ifndef SHUT_RDWR +#if defined(HAVE_DECL_SHUT_RD) && HAVE_DECL_SHUT_RD == 0 enum { SHUT_RD = 0, /* No more receptions. */ @@ -90,8 +90,8 @@ enum #endif #endif -#ifndef O_NONBLOCK /* Non Blocking Open */ -# define O_NONBLOCK 00004 +#if defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK == 0 +# define O_NONBLOCK 00004 /* Non Blocking Open */ #endif #ifndef S_ISDIR -- 2.45.1