1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

New diff that now covers the entire tree. Applying this gets postgresql

working on the VERY latest version of BeOS.  I'm sure there will be
alot of comments, but then if there weren't I'd be disappointed!

Thanks for your continuing efforts to get this into your tree.

Haven't bothered with the new files as they haven't changed.

BTW Peter, the compiler is "broken" about the bool define and so on.
I'm filing a bug report to try and get it addressed.  Hopefully then we
can tidy up the code a bit.

I await the replies with interest :)

David Reid
This commit is contained in:
Bruce Momjian
2000-10-03 03:11:26 +00:00
parent de1af06287
commit 87c0e623ba
20 changed files with 291 additions and 60 deletions

View File

@@ -29,7 +29,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pqcomm.c,v 1.103 2000/10/02 21:45:31 petere Exp $
* $Id: pqcomm.c,v 1.104 2000/10/03 03:11:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -208,11 +208,16 @@ StreamServerPort(int family, unsigned short portName, int *fdP)
MemSet((char *) &saddr, 0, sizeof(saddr));
saddr.sa.sa_family = family;
/* I know this isn't a good way of testing, but until we have a
* define for this it'll do!
* we have Unix sockets...
*/
#ifdef HAVE_SYS_UN_H
if (family == AF_UNIX)
{
len = UNIXSOCK_PATH(saddr.un, portName);
strcpy(sock_path, saddr.un.sun_path);
/*
* If the socket exists but nobody has an advisory lock on it we
* can safely delete the file.
@@ -231,13 +236,16 @@ StreamServerPort(int family, unsigned short portName, int *fdP)
}
#endif /* HAVE_FCNTL_SETLK */
}
else
{
#endif /* HAVE_SYS_UN_H */
if (family == AF_INET)
{
saddr.in.sin_addr.s_addr = htonl(INADDR_ANY);
saddr.in.sin_port = htons(portName);
len = sizeof(struct sockaddr_in);
}
err = bind(fd, &saddr.sa, len);
err = bind(fd, (struct sockaddr *)&saddr.sa, len);
if (err < 0)
{
snprintf(PQerrormsg, PQERRORMSG_LENGTH,
@@ -258,6 +266,7 @@ StreamServerPort(int family, unsigned short portName, int *fdP)
return STATUS_ERROR;
}
#ifdef HAVE_SYS_UN_H /* yeah I know... */
if (family == AF_UNIX)
{
on_proc_exit(StreamDoUnlink, 0);
@@ -279,6 +288,7 @@ StreamServerPort(int family, unsigned short portName, int *fdP)
}
#endif /* HAVE_FCNTL_SETLK */
}
#endif /* HAVE_SYS_UN_H */
listen(fd, SOMAXCONN);

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.26 2000/04/12 17:15:14 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.27 2000/10/03 03:11:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -61,7 +61,11 @@ PacketReceiveFragment(Port *port)
got = SSL_read(port->ssl, pkt->ptr, pkt->nrtodo);
else
#endif
#ifndef __BEOS__
got = read(port->sock, pkt->ptr, pkt->nrtodo);
#else
got = recv(port->sock, pkt->ptr, pkt->nrtodo, 0);
#endif /* __BEOS__ */
if (got > 0)
{
pkt->nrtodo -= got;
@@ -150,8 +154,11 @@ PacketSendFragment(Port *port)
done = SSL_write(port->ssl, pkt->ptr, pkt->nrtodo);
else
#endif
#ifndef __BEOS__
done = write(port->sock, pkt->ptr, pkt->nrtodo);
#else
done = send(port->sock, pkt->ptr, pkt->nrtodo, 0);
#endif
if (done > 0)
{
pkt->nrtodo -= done;