Check for cookie_io_functions_t provided by stdio.h

Do not check for libio.h, it's not included anyway.
Check for cookie_io_functions_t and conditionalize
on HAVE_COOKIE_IO_FUNCTIONS_T instead.
This commit is contained in:
Дмитрий Левин 2019-11-24 11:58:18 +00:00
parent 5133ad68aa
commit 90d5486688
3 changed files with 7 additions and 16 deletions

View File

@ -318,7 +318,7 @@ AC_CHECK_HEADERS(netinet/in_systm.h)
AC_CHECK_HEADERS(machine/types.h)
AC_CHECK_HEADERS(mntent.h sys/mnttab.h sys/systemcfg.h)
AC_CHECK_HEADERS(sys/mount.h sys/mntctl.h sys/param.h sys/vmount.h)
AC_CHECK_HEADERS(libio.h zlib.h)
AC_CHECK_HEADERS(zlib.h)
AC_CHECK_HEADERS(err.h mcheck.h syslog.h)
AC_CHECK_HEADERS(locale.h)
@ -327,6 +327,8 @@ AC_CHECK_HEADERS(float.h)
AC_CHECK_HEADERS(glob.h)
AC_CHECK_TYPES([cookie_io_functions_t],,, [#include <stdio.h>])
dnl statfs portability fiddles.
dnl
dnl We should really emulate/steal sections of the statfs and struct statfs

View File

@ -30,10 +30,6 @@ typedef int int32_t;
# include <netinet/in_systm.h>
#endif
#if HAVE_LIBIO_H && defined(_G_IO_IO_FILE_VERSION)
#define _USE_LIBIO 1
#endif
#if !defined(HAVE_HERRNO) && defined(__hpux) /* XXX HP-UX w/o -D_XOPEN_SOURCE needs */
/*@unchecked@*/
extern int h_errno;
@ -95,7 +91,7 @@ static int inet_aton(const char *cp, struct in_addr *inp)
/**
*/
/*@unchecked@*/
#if _USE_LIBIO
#ifdef HAVE_COOKIE_IO_FUNCTIONS_T
int noLibio = 0;
#else
int noLibio = 1;
@ -3455,13 +3451,6 @@ static inline void cvtfmode (const char *m,
*f = flags;
}
#if _USE_LIBIO
#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ == 0
/* XXX retrofit glibc-2.1.x typedef on glibc-2.0.x systems */
typedef _IO_cookie_io_functions_t cookie_io_functions_t;
#endif
#endif
FD_t Fdopen(FD_t ofd, const char *fmode)
{
char stdio[20], other[20], zstdio[20];
@ -3548,7 +3537,7 @@ fprintf(stderr, "*** Fdopen fpio fp %p\n", (void *)fp);
if (!noLibio) {
FILE * fp = NULL;
#if _USE_LIBIO
#ifdef HAVE_COOKIE_IO_FUNCTIONS_T
{ cookie_io_functions_t ciof;
ciof.read = iof->read;
ciof.write = iof->write;

View File

@ -143,7 +143,7 @@ static struct poptOption rpmAllPoptTable[] = {
N_("display final rpmrc and macro configuration"),
NULL },
#if HAVE_LIBIO_H && defined(_G_IO_IO_FILE_VERSION)
#ifdef HAVE_COOKIE_IO_FUNCTIONS_T
{ "nolibio", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noLibio, 1,
N_("disable use of libio(3) API"), NULL},
#endif
@ -352,7 +352,7 @@ int main(int argc, const char ** argv)
/* set the defaults for the various command line options */
_ftp_debug = 0;
#if HAVE_LIBIO_H && defined(_G_IO_IO_FILE_VERSION)
#ifdef HAVE_COOKIE_IO_FUNCTIONS_T
noLibio = 0;
#else
noLibio = 1;