mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-30 16:51:14 +02:00
Back out incorrect commit.
This commit is contained in:
parent
eef7e30cc1
commit
a970a8cb95
15
configure
vendored
15
configure
vendored
@ -20908,8 +20908,6 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if test x"$template" != x"win32"
|
|
||||||
then
|
|
||||||
echo "$as_me:$LINENO: checking for POSIX signal interface" >&5
|
echo "$as_me:$LINENO: checking for POSIX signal interface" >&5
|
||||||
echo $ECHO_N "checking for POSIX signal interface... $ECHO_C" >&6
|
echo $ECHO_N "checking for POSIX signal interface... $ECHO_C" >&6
|
||||||
if test "${pgac_cv_func_posix_signals+set}" = set; then
|
if test "${pgac_cv_func_posix_signals+set}" = set; then
|
||||||
@ -20988,7 +20986,6 @@ echo "$as_me: error:
|
|||||||
" >&2;}
|
" >&2;}
|
||||||
{ (exit 1); exit 1; }; }
|
{ (exit 1); exit 1; }; }
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if test $ac_cv_func_fseeko = yes; then
|
if test $ac_cv_func_fseeko = yes; then
|
||||||
# Check whether --enable-largefile or --disable-largefile was given.
|
# Check whether --enable-largefile or --disable-largefile was given.
|
||||||
@ -22435,8 +22432,6 @@ done
|
|||||||
# defined. Cross compiling throws a warning.
|
# defined. Cross compiling throws a warning.
|
||||||
#
|
#
|
||||||
if test "$enable_thread_safety_force" = yes; then
|
if test "$enable_thread_safety_force" = yes; then
|
||||||
if test x"$template" != x"win32"
|
|
||||||
then
|
|
||||||
{ echo "$as_me:$LINENO: WARNING:
|
{ echo "$as_me:$LINENO: WARNING:
|
||||||
*** Skipping thread test program. --enable-thread-safety-force was used.
|
*** Skipping thread test program. --enable-thread-safety-force was used.
|
||||||
*** Run the program in src/tools/thread on the your machine and add
|
*** Run the program in src/tools/thread on the your machine and add
|
||||||
@ -22449,13 +22444,7 @@ echo "$as_me: WARNING:
|
|||||||
proper locking function calls to your applications to guarantee thread
|
proper locking function calls to your applications to guarantee thread
|
||||||
safety.
|
safety.
|
||||||
" >&2;}
|
" >&2;}
|
||||||
else
|
|
||||||
{ echo "$as_me:$LINENO: WARNING: *** Skipping thread test on Win32" >&5
|
|
||||||
echo "$as_me: WARNING: *** Skipping thread test on Win32" >&2;}
|
|
||||||
fi
|
|
||||||
elif test "$enable_thread_safety" = yes; then
|
elif test "$enable_thread_safety" = yes; then
|
||||||
if test x"$template" != x"win32"
|
|
||||||
then
|
|
||||||
echo "$as_me:$LINENO: checking thread safety of required library functions" >&5
|
echo "$as_me:$LINENO: checking thread safety of required library functions" >&5
|
||||||
echo $ECHO_N "checking thread safety of required library functions... $ECHO_C" >&6
|
echo $ECHO_N "checking thread safety of required library functions... $ECHO_C" >&6
|
||||||
|
|
||||||
@ -22528,10 +22517,6 @@ rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftes
|
|||||||
fi
|
fi
|
||||||
CFLAGS="$_CFLAGS"
|
CFLAGS="$_CFLAGS"
|
||||||
LIBS="$_LIBS"
|
LIBS="$_LIBS"
|
||||||
else
|
|
||||||
{ echo "$as_me:$LINENO: WARNING: *** Skipping thread test on Win32" >&5
|
|
||||||
echo "$as_me: WARNING: *** Skipping thread test on Win32" >&2;}
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# prepare build tree if outside source tree
|
# prepare build tree if outside source tree
|
||||||
|
15
configure.in
15
configure.in
@ -1,5 +1,5 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
dnl $PostgreSQL: pgsql/configure.in,v 1.421 2005/08/23 20:45:04 momjian Exp $
|
dnl $PostgreSQL: pgsql/configure.in,v 1.422 2005/08/23 20:48:44 momjian Exp $
|
||||||
dnl
|
dnl
|
||||||
dnl Developers, please strive to achieve this order:
|
dnl Developers, please strive to achieve this order:
|
||||||
dnl
|
dnl
|
||||||
@ -1172,8 +1172,6 @@ AC_CHECK_TYPES([int8, uint8, int64, uint64], [], [],
|
|||||||
AC_CHECK_TYPES(sig_atomic_t, [], [], [#include <signal.h>])
|
AC_CHECK_TYPES(sig_atomic_t, [], [], [#include <signal.h>])
|
||||||
|
|
||||||
|
|
||||||
if test x"$template" != x"win32"
|
|
||||||
then
|
|
||||||
PGAC_FUNC_POSIX_SIGNALS
|
PGAC_FUNC_POSIX_SIGNALS
|
||||||
if test "$pgac_cv_func_posix_signals" != yes -a "$enable_thread_safety" = yes; then
|
if test "$pgac_cv_func_posix_signals" != yes -a "$enable_thread_safety" = yes; then
|
||||||
AC_MSG_ERROR([
|
AC_MSG_ERROR([
|
||||||
@ -1181,7 +1179,6 @@ if test "$pgac_cv_func_posix_signals" != yes -a "$enable_thread_safety" = yes; t
|
|||||||
*** operating system.
|
*** operating system.
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if test $ac_cv_func_fseeko = yes; then
|
if test $ac_cv_func_fseeko = yes; then
|
||||||
AC_SYS_LARGEFILE
|
AC_SYS_LARGEFILE
|
||||||
@ -1244,20 +1241,13 @@ AC_CHECK_PROGS(SGMLSPL, sgmlspl)
|
|||||||
# defined. Cross compiling throws a warning.
|
# defined. Cross compiling throws a warning.
|
||||||
#
|
#
|
||||||
if test "$enable_thread_safety_force" = yes; then
|
if test "$enable_thread_safety_force" = yes; then
|
||||||
if test x"$template" != x"win32"
|
|
||||||
then
|
|
||||||
AC_MSG_WARN([
|
AC_MSG_WARN([
|
||||||
*** Skipping thread test program. --enable-thread-safety-force was used.
|
*** Skipping thread test program. --enable-thread-safety-force was used.
|
||||||
*** Run the program in src/tools/thread on the your machine and add
|
*** Run the program in src/tools/thread on the your machine and add
|
||||||
proper locking function calls to your applications to guarantee thread
|
proper locking function calls to your applications to guarantee thread
|
||||||
safety.
|
safety.
|
||||||
])
|
])
|
||||||
else
|
|
||||||
AC_MSG_WARN([*** Skipping thread test on Win32])
|
|
||||||
fi
|
|
||||||
elif test "$enable_thread_safety" = yes; then
|
elif test "$enable_thread_safety" = yes; then
|
||||||
if test x"$template" != x"win32"
|
|
||||||
then
|
|
||||||
AC_MSG_CHECKING([thread safety of required library functions])
|
AC_MSG_CHECKING([thread safety of required library functions])
|
||||||
|
|
||||||
_CFLAGS="$CFLAGS"
|
_CFLAGS="$CFLAGS"
|
||||||
@ -1283,9 +1273,6 @@ AC_TRY_RUN([#include "$srcdir/src/tools/thread/thread_test.c"],
|
|||||||
])])
|
])])
|
||||||
CFLAGS="$_CFLAGS"
|
CFLAGS="$_CFLAGS"
|
||||||
LIBS="$_LIBS"
|
LIBS="$_LIBS"
|
||||||
else
|
|
||||||
AC_MSG_WARN([*** Skipping thread test on Win32])
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# prepare build tree if outside source tree
|
# prepare build tree if outside source tree
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.347 2005/08/23 20:45:05 momjian Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.348 2005/08/23 20:48:45 momjian Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<appendix id="release">
|
<appendix id="release">
|
||||||
@ -1078,7 +1078,7 @@ $PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.347 2005/08/23 20:45:05 momjian
|
|||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
<function>pg_complete_relation_size()</> includes indexes and TOAST
|
<function>complete_relation_size()</> includes indexes and TOAST
|
||||||
tables.
|
tables.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
# Portions Copyright (c) 1994, Regents of the University of California
|
# Portions Copyright (c) 1994, Regents of the University of California
|
||||||
#
|
#
|
||||||
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.135 2005/08/23 20:45:06 momjian Exp $
|
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.136 2005/08/23 20:48:46 momjian Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -43,7 +43,9 @@ libpqrc.o: libpq.rc
|
|||||||
windres -i libpq.rc -o libpqrc.o
|
windres -i libpq.rc -o libpqrc.o
|
||||||
|
|
||||||
ifeq ($(enable_thread_safety), yes)
|
ifeq ($(enable_thread_safety), yes)
|
||||||
|
# This doesn't work yet because configure test fails. 2004-06-19
|
||||||
OBJS += pthread-win32.o
|
OBJS += pthread-win32.o
|
||||||
|
PTHREAD_H_WIN32 = pthread.h
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -57,7 +59,7 @@ SHLIB_LINK += -lshfolder -lwsock32 -lws2_32 $(filter -leay32 -lssleay32 -lcomerr
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
all: def-files $(srcdir)/libpq.rc all-lib
|
all: $(PTHREAD_H_WIN32) def-files $(srcdir)/libpq.rc all-lib
|
||||||
|
|
||||||
# Shared library stuff
|
# Shared library stuff
|
||||||
include $(top_srcdir)/src/Makefile.shlib
|
include $(top_srcdir)/src/Makefile.shlib
|
||||||
@ -120,6 +122,11 @@ $(srcdir)/blibpqdll.def: exports.txt
|
|||||||
$(srcdir)/libpq.rc: libpq.rc.in $(top_builddir)/src/Makefile.global
|
$(srcdir)/libpq.rc: libpq.rc.in $(top_builddir)/src/Makefile.global
|
||||||
sed -e 's/\(VERSION.*\),0 *$$/\1,'`date '+%y%j' | sed 's/^0*//'`'/' < $< > $@
|
sed -e 's/\(VERSION.*\),0 *$$/\1,'`date '+%y%j' | sed 's/^0*//'`'/' < $< > $@
|
||||||
|
|
||||||
|
ifneq ($(PTHREAD_H_WIN32), "")
|
||||||
|
pthread.h: $(top_srcdir)/src/interfaces/libpq/pthread.h.win
|
||||||
|
rm -f $@ && $(LN_S) $< .
|
||||||
|
endif
|
||||||
|
|
||||||
fe-connect.o: fe-connect.c $(top_builddir)/src/port/pg_config_paths.h
|
fe-connect.o: fe-connect.c $(top_builddir)/src/port/pg_config_paths.h
|
||||||
|
|
||||||
$(top_builddir)/src/port/pg_config_paths.h:
|
$(top_builddir)/src/port/pg_config_paths.h:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.318 2005/08/23 20:45:06 momjian Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.319 2005/08/23 20:48:46 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -55,12 +55,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_THREAD_SAFETY
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
#ifdef WIN32
|
|
||||||
#include "pthread-win32.h"
|
|
||||||
#else
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "libpq/ip.h"
|
#include "libpq/ip.h"
|
||||||
#include "mb/pg_wchar.h"
|
#include "mb/pg_wchar.h"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.172 2005/08/23 20:45:07 momjian Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.173 2005/08/23 20:48:47 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -2156,16 +2156,25 @@ PQoidValue(const PGresult *res)
|
|||||||
char *endptr = NULL;
|
char *endptr = NULL;
|
||||||
unsigned long result;
|
unsigned long result;
|
||||||
|
|
||||||
if (!res ||
|
if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0)
|
||||||
!res->cmdStatus ||
|
|
||||||
strncmp(res->cmdStatus, "INSERT ", 7) != 0 ||
|
|
||||||
res->cmdStatus[7] < '0' ||
|
|
||||||
res->cmdStatus[7] > '9')
|
|
||||||
return InvalidOid;
|
return InvalidOid;
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
SetLastError(0);
|
||||||
|
#else
|
||||||
|
errno = 0;
|
||||||
|
#endif
|
||||||
result = strtoul(res->cmdStatus + 7, &endptr, 10);
|
result = strtoul(res->cmdStatus + 7, &endptr, 10);
|
||||||
|
|
||||||
if (!endptr || (*endptr != ' ' && *endptr != '\0'))
|
if (!endptr || (*endptr != ' ' && *endptr != '\0')
|
||||||
|
#ifndef WIN32
|
||||||
|
/*
|
||||||
|
* On WIN32, errno is not thread-safe and GetLastError() isn't set by
|
||||||
|
* strtoul(), so we can't check on this platform.
|
||||||
|
*/
|
||||||
|
|| errno == ERANGE
|
||||||
|
#endif
|
||||||
|
)
|
||||||
return InvalidOid;
|
return InvalidOid;
|
||||||
else
|
else
|
||||||
return (Oid) result;
|
return (Oid) result;
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.117 2005/08/23 20:45:07 momjian Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.118 2005/08/23 20:48:47 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1133,11 +1133,7 @@ libpq_gettext(const char *msgid)
|
|||||||
if (!already_bound)
|
if (!already_bound)
|
||||||
{
|
{
|
||||||
/* dgettext() preserves errno, but bindtextdomain() doesn't */
|
/* dgettext() preserves errno, but bindtextdomain() doesn't */
|
||||||
#ifdef WIN32
|
|
||||||
int save_errno = GetLastError();
|
|
||||||
#else
|
|
||||||
int save_errno = errno;
|
int save_errno = errno;
|
||||||
#endif
|
|
||||||
const char *ldir;
|
const char *ldir;
|
||||||
|
|
||||||
already_bound = true;
|
already_bound = true;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* didn't really belong there.
|
* didn't really belong there.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-print.c,v 1.61 2005/08/23 20:45:07 momjian Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-print.c,v 1.62 2005/08/23 20:48:47 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -88,7 +88,7 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
|
|||||||
int total_line_length = 0;
|
int total_line_length = 0;
|
||||||
int usePipe = 0;
|
int usePipe = 0;
|
||||||
char *pagerenv;
|
char *pagerenv;
|
||||||
#if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32)
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
sigset_t osigset;
|
sigset_t osigset;
|
||||||
bool sigpipe_masked = false;
|
bool sigpipe_masked = false;
|
||||||
bool sigpipe_pending;
|
bool sigpipe_pending;
|
||||||
@ -189,14 +189,14 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
|
|||||||
if (fout)
|
if (fout)
|
||||||
{
|
{
|
||||||
usePipe = 1;
|
usePipe = 1;
|
||||||
#ifndef WIN32
|
|
||||||
#ifdef ENABLE_THREAD_SAFETY
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
|
if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
|
||||||
sigpipe_masked = true;
|
sigpipe_masked = true;
|
||||||
#else
|
#else
|
||||||
|
#ifndef WIN32
|
||||||
oldsigpipehandler = pqsignal(SIGPIPE, SIG_IGN);
|
oldsigpipehandler = pqsignal(SIGPIPE, SIG_IGN);
|
||||||
#endif /* ENABLE_THREAD_SAFETY */
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fout = stdout;
|
fout = stdout;
|
||||||
@ -311,15 +311,16 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
|
|||||||
_pclose(fout);
|
_pclose(fout);
|
||||||
#else
|
#else
|
||||||
pclose(fout);
|
pclose(fout);
|
||||||
|
#endif
|
||||||
#ifdef ENABLE_THREAD_SAFETY
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
/* we can't easily verify if EPIPE occurred, so say it did */
|
/* we can't easily verify if EPIPE occurred, so say it did */
|
||||||
if (sigpipe_masked)
|
if (sigpipe_masked)
|
||||||
pq_reset_sigpipe(&osigset, sigpipe_pending, true);
|
pq_reset_sigpipe(&osigset, sigpipe_pending, true);
|
||||||
#else
|
#else
|
||||||
|
#ifndef WIN32
|
||||||
pqsignal(SIGPIPE, oldsigpipehandler);
|
pqsignal(SIGPIPE, oldsigpipehandler);
|
||||||
#endif /* ENABLE_THREAD_SAFETY */
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif
|
||||||
}
|
}
|
||||||
if (po->html3 && !po->expanded)
|
if (po->html3 && !po->expanded)
|
||||||
fputs("</table>\n", fout);
|
fputs("</table>\n", fout);
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.68 2005/08/23 20:45:07 momjian Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.69 2005/08/23 20:48:47 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
|
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
|
||||||
@ -103,12 +103,8 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#ifdef ENABLE_THREAD_SAFETY
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
#ifdef WIN32
|
|
||||||
#include "pthread-win32.h"
|
|
||||||
#else
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_STRDUP
|
#ifndef HAVE_STRDUP
|
||||||
#include "strdup.h"
|
#include "strdup.h"
|
||||||
@ -393,19 +389,18 @@ pqsecure_write(PGconn *conn, const void *ptr, size_t len)
|
|||||||
{
|
{
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
#ifdef ENABLE_THREAD_SAFETY
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
sigset_t osigmask;
|
sigset_t osigmask;
|
||||||
bool sigpipe_pending;
|
bool sigpipe_pending;
|
||||||
bool got_epipe = false;
|
bool got_epipe = false;
|
||||||
|
|
||||||
|
|
||||||
if (pq_block_sigpipe(&osigmask, &sigpipe_pending) < 0)
|
if (pq_block_sigpipe(&osigmask, &sigpipe_pending) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
#else
|
#else
|
||||||
|
#ifndef WIN32
|
||||||
pqsigfunc oldsighandler = pqsignal(SIGPIPE, SIG_IGN);
|
pqsigfunc oldsighandler = pqsignal(SIGPIPE, SIG_IGN);
|
||||||
#endif /* ENABLE_THREAD_SAFETY */
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif
|
||||||
|
|
||||||
#ifdef USE_SSL
|
#ifdef USE_SSL
|
||||||
if (conn->ssl)
|
if (conn->ssl)
|
||||||
@ -436,7 +431,7 @@ pqsecure_write(PGconn *conn, const void *ptr, size_t len)
|
|||||||
|
|
||||||
if (n == -1)
|
if (n == -1)
|
||||||
{
|
{
|
||||||
#if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32)
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
if (SOCK_ERRNO == EPIPE)
|
if (SOCK_ERRNO == EPIPE)
|
||||||
got_epipe = true;
|
got_epipe = true;
|
||||||
#endif
|
#endif
|
||||||
@ -478,19 +473,19 @@ pqsecure_write(PGconn *conn, const void *ptr, size_t len)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
n = send(conn->sock, ptr, len, 0);
|
n = send(conn->sock, ptr, len, 0);
|
||||||
#if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32)
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
if (n < 0 && SOCK_ERRNO == EPIPE)
|
if (n < 0 && SOCK_ERRNO == EPIPE)
|
||||||
got_epipe = true;
|
got_epipe = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
#ifdef ENABLE_THREAD_SAFETY
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
pq_reset_sigpipe(&osigmask, sigpipe_pending, got_epipe);
|
pq_reset_sigpipe(&osigmask, sigpipe_pending, got_epipe);
|
||||||
#else
|
#else
|
||||||
|
#ifndef WIN32
|
||||||
pqsignal(SIGPIPE, oldsighandler);
|
pqsignal(SIGPIPE, oldsighandler);
|
||||||
#endif /* ENABLE_THREAD_SAFETY */
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif
|
||||||
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
@ -1237,7 +1232,7 @@ PQgetssl(PGconn *conn)
|
|||||||
|
|
||||||
#endif /* USE_SSL */
|
#endif /* USE_SSL */
|
||||||
|
|
||||||
#if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32)
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Block SIGPIPE for this thread. This prevents send()/write() from exiting
|
* Block SIGPIPE for this thread. This prevents send()/write() from exiting
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.105 2005/08/23 20:45:07 momjian Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.106 2005/08/23 20:48:47 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -30,11 +30,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_THREAD_SAFETY
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
#ifdef WIN32
|
|
||||||
#include "pthread-win32.h"
|
|
||||||
#else
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -485,7 +481,7 @@ extern void pqsecure_close(PGconn *);
|
|||||||
extern ssize_t pqsecure_read(PGconn *, void *ptr, size_t len);
|
extern ssize_t pqsecure_read(PGconn *, void *ptr, size_t len);
|
||||||
extern ssize_t pqsecure_write(PGconn *, const void *ptr, size_t len);
|
extern ssize_t pqsecure_write(PGconn *, const void *ptr, size_t len);
|
||||||
|
|
||||||
#if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32)
|
#ifdef ENABLE_THREAD_SAFETY
|
||||||
extern int pq_block_sigpipe(sigset_t *osigset, bool *sigpipe_pending);
|
extern int pq_block_sigpipe(sigset_t *osigset, bool *sigpipe_pending);
|
||||||
extern void pq_reset_sigpipe(sigset_t *osigset, bool sigpipe_pending,
|
extern void pq_reset_sigpipe(sigset_t *osigset, bool sigpipe_pending,
|
||||||
bool got_epipe);
|
bool got_epipe);
|
||||||
|
@ -5,14 +5,14 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2004-2005, PostgreSQL Global Development Group
|
* Copyright (c) 2004-2005, PostgreSQL Global Development Group
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/pthread-win32.c,v 1.6 2005/08/23 20:45:07 momjian Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/pthread-win32.c,v 1.7 2005/08/23 20:48:47 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "pthread-win32.h"
|
#include "pthread.h"
|
||||||
|
|
||||||
HANDLE
|
HANDLE
|
||||||
pthread_self()
|
pthread_self()
|
||||||
|
@ -14,36 +14,3 @@ If your platform requires special thread flags that are not tested by
|
|||||||
/config/acx_pthread.m4, add PTHREAD_CFLAGS and PTHREAD_LIBS defines to
|
/config/acx_pthread.m4, add PTHREAD_CFLAGS and PTHREAD_LIBS defines to
|
||||||
your template/${port} file.
|
your template/${port} file.
|
||||||
|
|
||||||
Windows Systems
|
|
||||||
===============
|
|
||||||
|
|
||||||
Windows systems do not vary in their thread-safeness in the same way that
|
|
||||||
other systems might, nor do they generally have pthreads installed, hence
|
|
||||||
on Windows this test is skipped by the configure program (pthreads is
|
|
||||||
required by the test program, but not PostgreSQL itself). If you do wish
|
|
||||||
to test your system however, you can do so as follows:
|
|
||||||
|
|
||||||
1) Install pthreads in you Mingw/Msys environment. You can download pthreads
|
|
||||||
from ftp://sources.redhat.com/pub/pthreads-win32/.
|
|
||||||
|
|
||||||
2) Build the test program:
|
|
||||||
|
|
||||||
gcc -o thread_test.exe \
|
|
||||||
-D_REENTRANT \
|
|
||||||
-D_THREAD_SAFE \
|
|
||||||
-D_POSIX_PTHREAD_SEMANTICS \
|
|
||||||
-I../../../src/include/port/win32 \
|
|
||||||
thread_test.c \
|
|
||||||
-lwsock32 \
|
|
||||||
-lpthreadgc2
|
|
||||||
|
|
||||||
3) Run thread_test.exe. You should see output like:
|
|
||||||
|
|
||||||
dpage@PC30:/cvs/pgsql/src/tools/thread$ ./thread_test
|
|
||||||
Your GetLastError() is thread-safe.
|
|
||||||
Your system uses strerror() which is thread-safe.
|
|
||||||
getpwuid_r()/getpwuid() are not applicable to Win32 platforms.
|
|
||||||
Your system uses gethostbyname which is thread-safe.
|
|
||||||
|
|
||||||
Your platform is thread-safe.
|
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.38 2005/08/23 20:45:11 momjian Exp $
|
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.39 2005/08/23 20:48:47 momjian Exp $
|
||||||
*
|
*
|
||||||
* This program tests to see if your standard libc functions use
|
* This program tests to see if your standard libc functions use
|
||||||
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
|
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
|
||||||
@ -20,7 +20,7 @@
|
|||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(IN_CONFIGURE) && !defined(WIN32)
|
#ifndef IN_CONFIGURE
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
#else
|
#else
|
||||||
/* From src/include/c.h" */
|
/* From src/include/c.h" */
|
||||||
@ -47,43 +47,12 @@ typedef char bool;
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************
|
|
||||||
* Windows Hacks
|
|
||||||
*****************************************************************/
|
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#define MAXHOSTNAMELEN 63
|
|
||||||
#include <winsock2.h>
|
|
||||||
|
|
||||||
int mkstemp(char *template);
|
|
||||||
|
|
||||||
int
|
|
||||||
mkstemp(char *template)
|
|
||||||
{
|
|
||||||
FILE *foo;
|
|
||||||
|
|
||||||
mktemp(template);
|
|
||||||
foo = fopen(template, "rw");
|
|
||||||
if (!foo)
|
|
||||||
return -1;
|
|
||||||
else
|
|
||||||
return (int)foo;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/******************************************************************
|
|
||||||
* End Windows Hacks
|
|
||||||
*****************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
/* Test for POSIX.1c 2-arg sigwait() and fail on single-arg version */
|
/* Test for POSIX.1c 2-arg sigwait() and fail on single-arg version */
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
int sigwait(const sigset_t *set, int *sig);
|
int sigwait(const sigset_t *set, int *sig);
|
||||||
|
|
||||||
|
|
||||||
#if !defined(ENABLE_THREAD_SAFETY) && !defined(IN_CONFIGURE) && !(defined(WIN32))
|
#if !defined(ENABLE_THREAD_SAFETY) && !defined(IN_CONFIGURE)
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -100,13 +69,8 @@ main(int argc, char *argv[])
|
|||||||
static void func_call_1(void);
|
static void func_call_1(void);
|
||||||
static void func_call_2(void);
|
static void func_call_2(void);
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#define TEMP_FILENAME_1 "thread_test.1.XXXXXX"
|
|
||||||
#define TEMP_FILENAME_2 "thread_test.2.XXXXXX"
|
|
||||||
#else
|
|
||||||
#define TEMP_FILENAME_1 "/tmp/thread_test.1.XXXXXX"
|
#define TEMP_FILENAME_1 "/tmp/thread_test.1.XXXXXX"
|
||||||
#define TEMP_FILENAME_2 "/tmp/thread_test.2.XXXXXX"
|
#define TEMP_FILENAME_2 "/tmp/thread_test.2.XXXXXX"
|
||||||
#endif
|
|
||||||
|
|
||||||
static char *temp_filename_1;
|
static char *temp_filename_1;
|
||||||
static char *temp_filename_2;
|
static char *temp_filename_2;
|
||||||
@ -125,13 +89,11 @@ static char *strerror_p2;
|
|||||||
static bool strerror_threadsafe = false;
|
static bool strerror_threadsafe = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
#ifndef HAVE_GETPWUID_R
|
#ifndef HAVE_GETPWUID_R
|
||||||
static struct passwd *passwd_p1;
|
static struct passwd *passwd_p1;
|
||||||
static struct passwd *passwd_p2;
|
static struct passwd *passwd_p2;
|
||||||
static bool getpwuid_threadsafe = false;
|
static bool getpwuid_threadsafe = false;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
|
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
|
||||||
static struct hostent *hostent_p1;
|
static struct hostent *hostent_p1;
|
||||||
@ -148,10 +110,6 @@ main(int argc, char *argv[])
|
|||||||
pthread_t thread1,
|
pthread_t thread1,
|
||||||
thread2;
|
thread2;
|
||||||
int fd;
|
int fd;
|
||||||
#ifdef WIN32
|
|
||||||
WSADATA wsaData;
|
|
||||||
int err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
{
|
{
|
||||||
@ -165,14 +123,6 @@ main(int argc, char *argv[])
|
|||||||
dup(5);
|
dup(5);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
err = WSAStartup(MAKEWORD(1, 1), &wsaData);
|
|
||||||
if (err != 0) {
|
|
||||||
fprintf(stderr, "Cannot start the network subsystem - %d**\nexiting\n", err);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Make temp filenames, might not have strdup() */
|
/* Make temp filenames, might not have strdup() */
|
||||||
temp_filename_1 = malloc(strlen(TEMP_FILENAME_1) + 1);
|
temp_filename_1 = malloc(strlen(TEMP_FILENAME_1) + 1);
|
||||||
strcpy(temp_filename_1, TEMP_FILENAME_1);
|
strcpy(temp_filename_1, TEMP_FILENAME_1);
|
||||||
@ -201,23 +151,18 @@ main(int argc, char *argv[])
|
|||||||
while (thread1_done == 0 || thread2_done == 0)
|
while (thread1_done == 0 || thread2_done == 0)
|
||||||
sched_yield(); /* if this is a portability problem,
|
sched_yield(); /* if this is a portability problem,
|
||||||
* remove it */
|
* remove it */
|
||||||
#ifdef WIN32
|
|
||||||
printf("Your GetLastError() is thread-safe.\n");
|
|
||||||
#else
|
|
||||||
printf("Your errno is thread-safe.\n");
|
printf("Your errno is thread-safe.\n");
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_STRERROR_R
|
#ifndef HAVE_STRERROR_R
|
||||||
if (strerror_p1 != strerror_p2)
|
if (strerror_p1 != strerror_p2)
|
||||||
strerror_threadsafe = true;
|
strerror_threadsafe = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
#ifndef HAVE_GETPWUID_R
|
#ifndef HAVE_GETPWUID_R
|
||||||
if (passwd_p1 != passwd_p2)
|
if (passwd_p1 != passwd_p2)
|
||||||
getpwuid_threadsafe = true;
|
getpwuid_threadsafe = true;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
|
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
|
||||||
if (hostent_p1 != hostent_p2)
|
if (hostent_p1 != hostent_p2)
|
||||||
@ -242,7 +187,6 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
#ifdef HAVE_GETPWUID_R
|
#ifdef HAVE_GETPWUID_R
|
||||||
printf("Your system has getpwuid_r(); it does not need getpwuid().\n");
|
printf("Your system has getpwuid_r(); it does not need getpwuid().\n");
|
||||||
#else
|
#else
|
||||||
@ -255,9 +199,6 @@ main(int argc, char *argv[])
|
|||||||
platform_is_threadsafe = false;
|
platform_is_threadsafe = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
printf("getpwuid_r()/getpwuid() are not applicable to Win32 platforms.\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_GETADDRINFO
|
#ifdef HAVE_GETADDRINFO
|
||||||
printf("Your system has getaddrinfo(); it does not need gethostbyname()\n"
|
printf("Your system has getaddrinfo(); it does not need gethostbyname()\n"
|
||||||
@ -297,30 +238,14 @@ func_call_1(void)
|
|||||||
!defined(HAVE_GETHOSTBYNAME_R))
|
!defined(HAVE_GETHOSTBYNAME_R))
|
||||||
void *p;
|
void *p;
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
|
||||||
HANDLE h1;
|
|
||||||
HANDLE h2;
|
|
||||||
#endif
|
|
||||||
unlink(temp_filename_1);
|
unlink(temp_filename_1);
|
||||||
|
|
||||||
|
|
||||||
/* create, then try to fail on exclusive create open */
|
/* create, then try to fail on exclusive create open */
|
||||||
#ifdef WIN32
|
|
||||||
h1 = CreateFile(temp_filename_1, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, 0, NULL);
|
|
||||||
h2 = CreateFile(temp_filename_1, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, NULL);
|
|
||||||
if (h1 == INVALID_HANDLE_VALUE || GetLastError() != ERROR_FILE_EXISTS)
|
|
||||||
#else
|
|
||||||
if (open(temp_filename_1, O_RDWR | O_CREAT, 0600) < 0 ||
|
if (open(temp_filename_1, O_RDWR | O_CREAT, 0600) < 0 ||
|
||||||
open(temp_filename_1, O_RDWR | O_CREAT | O_EXCL, 0600) >= 0)
|
open(temp_filename_1, O_RDWR | O_CREAT | O_EXCL, 0600) >= 0)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
|
||||||
fprintf(stderr, "Could not create file in current directory or\n");
|
|
||||||
fprintf(stderr, "Could not generate failure for create file in current directory **\nexiting\n");
|
|
||||||
#else
|
|
||||||
fprintf(stderr, "Could not create file in /tmp or\n");
|
fprintf(stderr, "Could not create file in /tmp or\n");
|
||||||
fprintf(stderr, "Could not generate failure for create file in /tmp **\nexiting\n");
|
fprintf(stderr, "Could not generate failure for create file in /tmp **\nexiting\n");
|
||||||
#endif
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,17 +256,9 @@ func_call_1(void)
|
|||||||
errno1_set = 1;
|
errno1_set = 1;
|
||||||
while (errno2_set == 0)
|
while (errno2_set == 0)
|
||||||
sched_yield();
|
sched_yield();
|
||||||
#ifdef WIN32
|
|
||||||
if (GetLastError() != ERROR_FILE_EXISTS)
|
|
||||||
#else
|
|
||||||
if (errno != EEXIST)
|
if (errno != EEXIST)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
|
||||||
fprintf(stderr, "GetLastError() not thread-safe **\nexiting\n");
|
|
||||||
#else
|
|
||||||
fprintf(stderr, "errno not thread-safe **\nexiting\n");
|
fprintf(stderr, "errno not thread-safe **\nexiting\n");
|
||||||
#endif
|
|
||||||
unlink(temp_filename_1);
|
unlink(temp_filename_1);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -357,7 +274,6 @@ func_call_1(void)
|
|||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
#ifndef HAVE_GETPWUID_R
|
#ifndef HAVE_GETPWUID_R
|
||||||
passwd_p1 = getpwuid(0);
|
passwd_p1 = getpwuid(0);
|
||||||
p = getpwuid(1);
|
p = getpwuid(1);
|
||||||
@ -367,7 +283,6 @@ func_call_1(void)
|
|||||||
passwd_p1 = NULL; /* force thread-safe failure report */
|
passwd_p1 = NULL; /* force thread-safe failure report */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
|
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
|
||||||
/* threads do this in opposite order */
|
/* threads do this in opposite order */
|
||||||
@ -397,12 +312,7 @@ func_call_2(void)
|
|||||||
|
|
||||||
unlink(temp_filename_2);
|
unlink(temp_filename_2);
|
||||||
/* open non-existant file */
|
/* open non-existant file */
|
||||||
#ifdef WIN32
|
|
||||||
CreateFile(temp_filename_2, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
|
|
||||||
if (GetLastError() != ERROR_FILE_NOT_FOUND)
|
|
||||||
#else
|
|
||||||
if (open(temp_filename_2, O_RDONLY, 0600) >= 0)
|
if (open(temp_filename_2, O_RDONLY, 0600) >= 0)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Read-only open succeeded without create **\nexiting\n");
|
fprintf(stderr, "Read-only open succeeded without create **\nexiting\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -415,17 +325,9 @@ func_call_2(void)
|
|||||||
errno2_set = 1;
|
errno2_set = 1;
|
||||||
while (errno1_set == 0)
|
while (errno1_set == 0)
|
||||||
sched_yield();
|
sched_yield();
|
||||||
#ifdef WIN32
|
|
||||||
if (GetLastError() != ENOENT)
|
|
||||||
#else
|
|
||||||
if (errno != ENOENT)
|
if (errno != ENOENT)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
|
||||||
fprintf(stderr, "GetLastError() not thread-safe **\nexiting\n");
|
|
||||||
#else
|
|
||||||
fprintf(stderr, "errno not thread-safe **\nexiting\n");
|
fprintf(stderr, "errno not thread-safe **\nexiting\n");
|
||||||
#endif
|
|
||||||
unlink(temp_filename_2);
|
unlink(temp_filename_2);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -441,7 +343,6 @@ func_call_2(void)
|
|||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
#ifndef HAVE_GETPWUID_R
|
#ifndef HAVE_GETPWUID_R
|
||||||
passwd_p2 = getpwuid(2);
|
passwd_p2 = getpwuid(2);
|
||||||
p = getpwuid(3);
|
p = getpwuid(3);
|
||||||
@ -451,7 +352,6 @@ func_call_2(void)
|
|||||||
passwd_p2 = NULL; /* force thread-safe failure report */
|
passwd_p2 = NULL; /* force thread-safe failure report */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
|
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
|
||||||
/* threads do this in opposite order */
|
/* threads do this in opposite order */
|
||||||
|
Loading…
Reference in New Issue
Block a user