Commit 3f123dcc authored by Brian Wellington's avatar Brian Wellington

487. [port] flockfile() is not defined on all systems.

Also check for libpthreads, if libpthread isn't found.
parent 36bc6a0a
487. [port] flockfile() is not defined on all systems.
486. [bug] nslookup: "set all" and "server" commands showed
the incorrect port number if a port other than 53
was specified. [RT #352]
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: acconfig.h,v 1.28 2000/09/15 20:50:31 bwelling Exp $ */
/* $Id: acconfig.h,v 1.29 2000/09/22 18:52:32 bwelling Exp $ */
/***
*** This file is not to be included by any public header files, because
......@@ -75,6 +75,9 @@
/* define if IPv6 is not disabled */
#undef WANT_IPV6
/* define if flockfile() is available */
#undef HAVE_FLOCKFILE
/* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */
#undef SHUTUP_SPUTAUX
#ifdef SHUTUP_SPUTAUX
......
......@@ -16,7 +16,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.h.in,v 1.37 2000/09/15 20:50:32 bwelling Exp $ */
/* $Id: config.h.in,v 1.38 2000/09/22 18:52:34 bwelling Exp $ */
/***
*** This file is not to be included by any public header files, because
......@@ -86,6 +86,9 @@
/* define if IPv6 is not disabled */
#undef WANT_IPV6
/* define if flockfile() is available */
#undef HAVE_FLOCKFILE
/* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */
#undef SHUTUP_SPUTAUX
#ifdef SHUTUP_SPUTAUX
......
This diff is collapsed.
......@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.185 $)
AC_REVISION($Revision: 1.186 $)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
......@@ -375,7 +375,8 @@ Please install the devel/unproven-pthreads package and rerun configure.
*)
AC_CHECK_LIB(pthread, pthread_create,,
AC_CHECK_LIB(pthread, __pthread_create)
AC_CHECK_LIB(pthread, __pthread_create_system))
AC_CHECK_LIB(pthread, __pthread_create_system)
AC_CHECK_LIB(pthreads, pthread_create))
;;
esac
......@@ -490,6 +491,12 @@ fi
ISC_THREAD_DIR=$thread_dir
AC_SUBST(ISC_THREAD_DIR)
#
# flockfile is usually provided by pthreads, but we may want to use it
# even if compiled with --disable-threads.
#
AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
#
# NLS
#
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lex.c,v 1.37 2000/08/30 01:28:10 bwelling Exp $ */
/* $Id: lex.c,v 1.38 2000/09/22 18:52:39 bwelling Exp $ */
#include <config.h>
......@@ -228,8 +228,7 @@ isc_lex_openfile(isc_lex_t *lex, const char *filename) {
if (result != ISC_R_SUCCESS)
return (result);
#if 0
/* XXX Anyone know why these are necessary? */
#ifdef HAVE_FLOCKFILE
flockfile(stream);
#endif
......@@ -246,7 +245,7 @@ isc_lex_openstream(isc_lex_t *lex, FILE *stream) {
REQUIRE(VALID_LEX(lex));
#if 0
#ifdef HAVE_FLOCKFILE
flockfile(stream);
#endif
/* This is safe. */
......@@ -287,7 +286,7 @@ isc_lex_close(isc_lex_t *lex) {
UNLINK(lex->sources, source, link);
if (source->is_file) {
#if 0
#ifdef HAVE_FLOCKFILE
funlockfile((FILE *)(source->input));
#endif
if (source->need_close)
......@@ -389,7 +388,11 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
} else if (source->is_file) {
stream = source->input;
#ifdef HAVE_FLOCKFILE
c = getc_unlocked(stream);
#else
c = getc(stream);
#endif
if (c == EOF) {
if (ferror(stream)) {
source->result = ISC_R_IOERROR;
......
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