1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-22 12:22:45 +03:00

Move non-blocking code into its own /port file, for code clarity.

This commit is contained in:
Bruce Momjian
2004-03-10 21:12:49 +00:00
parent ae22a6c185
commit 60a068b389
8 changed files with 53 additions and 39 deletions

View File

@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.97 2004/02/02 00:11:31 momjian Exp $
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.98 2004/03/10 21:12:46 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -23,7 +23,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS) -DFRONTEND -DSYS
OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
fe-protocol2.o fe-protocol3.o pqexpbuffer.o pqsignal.o fe-secure.o \
dllist.o md5.o ip.o wchar.o encnames.o \
$(filter crypt.o getaddrinfo.o inet_aton.o snprintf.o strerror.o path.o thread.o, $(LIBOBJS))
$(filter crypt.o getaddrinfo.o inet_aton.o nonblock.o snprintf.o strerror.o path.o thread.o, $(LIBOBJS))
ifeq ($(PORTNAME), win32)
OBJS+=win32.o
endif
@@ -52,7 +52,7 @@ backend_src = $(top_srcdir)/src/backend
# For port modules, this only happens if configure decides the module
# is needed (see filter hack in OBJS, above).
crypt.c getaddrinfo.c inet_aton.c snprintf.c strerror.c path.c thread.c: % : $(top_srcdir)/src/port/%
crypt.c getaddrinfo.c inet_aton.c nonblock.c snprintf.c strerror.c path.c thread.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
md5.c ip.c: % : $(backend_src)/libpq/%
@@ -78,4 +78,4 @@ uninstall: uninstall-lib
rm -f $(DESTDIR)$(includedir)/libpq-fe.h $(DESTDIR)$(includedir_internal)/libpq-int.h $(DESTDIR)$(includedir_internal)/pqexpbuffer.h
clean distclean maintainer-clean: clean-lib
rm -f $(OBJS) crypt.c getaddrinfo.c inet_aton.c snprintf.c strerror.c path.c thread.c dllist.c md5.c ip.c encnames.c wchar.c
rm -f $(OBJS) crypt.c getaddrinfo.c inet_aton.c nonblock.c snprintf.c strerror.c path.c thread.c dllist.c md5.c ip.c encnames.c wchar.c

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.267 2004/01/09 02:02:43 momjian Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.268 2004/03/10 21:12:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -50,11 +50,6 @@
#include "libpq/ip.h"
#include "mb/pg_wchar.h"
/* For FNCTL_NONBLOCK */
#if defined(WIN32) || defined(__BEOS__)
long ioctlsocket_ret=1;
#endif
#define PGPASSFILE ".pgpass"
/* fall back options if they are not specified by arguments or defined
@@ -779,7 +774,7 @@ update_db_info(PGconn *conn)
static int
connectMakeNonblocking(PGconn *conn)
{
if (FCNTL_NONBLOCK(conn->sock) < 0)
if (!set_noblock(conn->sock))
{
char sebuf[256];