Index: b/cipher/rndunix.c =================================================================== --- b/cipher/rndunix.c +++ b/cipher/rndunix.c @@ -50,6 +50,9 @@ #include #include #include +#ifdef HAVE_STDINT_H +# include +#endif #include #include @@ -700,12 +703,18 @@ { int nmax, n1, i; #ifdef _SC_OPEN_MAX if( (nmax=sysconf( _SC_OPEN_MAX )) < 0 ) { -#ifdef _POSIX_OPEN_MAX +# ifdef _POSIX_OPEN_MAX nmax = _POSIX_OPEN_MAX; -#else +# else nmax = 20; /* assume a reasonable value */ -#endif +# endif } + /* AIX returns INT32_MAX instead of a proper value. We assume that + * this is always an error and use a reasonable value. */ +# ifdef INT32_MAX + if (nmax == INT32_MAX) + nmax = 20; +# endif #else nmax = 20; /* assume a reasonable value */ #endif