mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Rename thread compile flag. Move thread test program to tools/thread,
and improve tests.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
# with broken/missing library files.
|
||||
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/port/Makefile,v 1.6 2003/08/13 03:12:04 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/port/Makefile,v 1.7 2003/09/27 15:32:48 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -23,7 +23,7 @@ libpgport.a: $(LIBOBJS)
|
||||
$(AR) crs $@ $^
|
||||
|
||||
thread.o: thread.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) $(THREAD_CFLAGS) -c $<
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) $(THREAD_CPPFLAGS) -c $<
|
||||
|
||||
clean distclean maintainer-clean:
|
||||
rm -f libpgport.a $(LIBOBJS)
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||
*
|
||||
* $Id: thread.c,v 1.8 2003/09/15 02:30:29 momjian Exp $
|
||||
* $Id: thread.c,v 1.9 2003/09/27 15:32:48 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -165,7 +165,9 @@ pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer,
|
||||
/*
|
||||
* Wrapper around gethostbyname() or gethostbyname_r() to mimic
|
||||
* POSIX gethostbyname_r() behaviour, if it is not available or required.
|
||||
* This function is called _only_ by our getaddinfo() portability function.
|
||||
*/
|
||||
#ifndef HAVE_GETADDRINFO
|
||||
int
|
||||
pqGethostbyname(const char *name,
|
||||
struct hostent *resultbuf,
|
||||
@@ -213,7 +215,7 @@ pqGethostbyname(const char *name,
|
||||
for (i = 0; (*result)->h_aliases[i]; i++, pointers++)
|
||||
len += (*result)->h_length;
|
||||
|
||||
if (MAXALIGN(len) + pointers * sizeof(char *) + strlen((*result)->h_name) + 1 <= buflen)
|
||||
if (pointers * sizeof(char *) + MAXALIGN(len) + strlen((*result)->h_name) + 1 <= buflen)
|
||||
{
|
||||
memcpy(resultbuf, *result, sizeof(struct hostent));
|
||||
|
||||
@@ -242,6 +244,7 @@ pqGethostbyname(const char *name,
|
||||
pbuffer++;
|
||||
|
||||
/* Place at end for cleaner alignment */
|
||||
buffer = MAXALIGN(buffer);
|
||||
strcpy(buffer, (*result)->h_name);
|
||||
resultbuf->h_name = buffer;
|
||||
buffer += strlen(resultbuf->h_name) + 1;
|
||||
@@ -269,3 +272,4 @@ pqGethostbyname(const char *name,
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user