mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Clean up indenting.
This commit is contained in:
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.8 1997/10/25 01:09:18 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.9 1997/11/10 05:15:49 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -241,7 +241,7 @@ strmake(char *str, int len)
|
|||||||
len = strlen(str);
|
len = strlen(str);
|
||||||
|
|
||||||
newstr = (char *) palloc((unsigned) len + 1);
|
newstr = (char *) palloc((unsigned) len + 1);
|
||||||
StrNCpy(newstr, str, len+1);
|
StrNCpy(newstr, str, len + 1);
|
||||||
newstr[len] = (char) 0;
|
newstr[len] = (char) 0;
|
||||||
return newstr;
|
return newstr;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.23 1997/11/07 20:51:27 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.24 1997/11/10 05:15:52 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -907,7 +907,7 @@ hba_recvauth(const Port *port, const char database[], const char user[],
|
|||||||
int retvalue;
|
int retvalue;
|
||||||
|
|
||||||
/* UNIX socket always OK, for now */
|
/* UNIX socket always OK, for now */
|
||||||
if(port->raddr.in.sin_family == AF_UNIX)
|
if (port->raddr.in.sin_family == AF_UNIX)
|
||||||
return STATUS_OK;
|
return STATUS_OK;
|
||||||
/* Our eventual return value */
|
/* Our eventual return value */
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.10 1997/10/25 01:09:21 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.11 1997/11/10 05:15:54 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -154,7 +154,7 @@ PQpnames(char **pnames, int rule_p)
|
|||||||
{
|
{
|
||||||
if (!rule_p || portals[i]->portal->rule_p)
|
if (!rule_p || portals[i]->portal->rule_p)
|
||||||
{
|
{
|
||||||
strncpy(pnames[cur_pname], portals[i]->name, PortalNameLength+1);
|
strncpy(pnames[cur_pname], portals[i]->name, PortalNameLength + 1);
|
||||||
++cur_pname;
|
++cur_pname;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.25 1997/11/10 02:21:18 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.26 1997/11/10 05:15:56 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -574,19 +574,24 @@ pq_async_notify()
|
|||||||
|
|
||||||
static char sock_path[100] = "";
|
static char sock_path[100] = "";
|
||||||
|
|
||||||
static void do_unlink()
|
static void
|
||||||
|
do_unlink()
|
||||||
{
|
{
|
||||||
if (sock_path[0]) unlink(sock_path);
|
if (sock_path[0])
|
||||||
|
unlink(sock_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
StreamServerPort(char *hostName, short portName, int *fdP)
|
StreamServerPort(char *hostName, short portName, int *fdP)
|
||||||
{
|
{
|
||||||
union {
|
union
|
||||||
|
{
|
||||||
struct sockaddr_in in;
|
struct sockaddr_in in;
|
||||||
struct sockaddr_un un;
|
struct sockaddr_un un;
|
||||||
} saddr;
|
} saddr;
|
||||||
int fd, err, family;
|
int fd,
|
||||||
|
err,
|
||||||
|
family;
|
||||||
size_t len;
|
size_t len;
|
||||||
int one = 1;
|
int one = 1;
|
||||||
|
|
||||||
@ -601,7 +606,8 @@ StreamServerPort(char *hostName, short portName, int *fdP)
|
|||||||
pqdebug("%s", PQerrormsg);
|
pqdebug("%s", PQerrormsg);
|
||||||
return (STATUS_ERROR);
|
return (STATUS_ERROR);
|
||||||
}
|
}
|
||||||
if (family == AF_UNIX) on_exitpg(do_unlink, (caddr_t) 0);
|
if (family == AF_UNIX)
|
||||||
|
on_exitpg(do_unlink, (caddr_t) 0);
|
||||||
if ((setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
|
if ((setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
|
||||||
sizeof(one))) == -1)
|
sizeof(one))) == -1)
|
||||||
{
|
{
|
||||||
@ -616,7 +622,7 @@ StreamServerPort(char *hostName, short portName, int *fdP)
|
|||||||
if (family == AF_UNIX)
|
if (family == AF_UNIX)
|
||||||
{
|
{
|
||||||
saddr.un.sun_family = family;
|
saddr.un.sun_family = family;
|
||||||
len = UNIXSOCK_PATH(saddr.un,portName);
|
len = UNIXSOCK_PATH(saddr.un, portName);
|
||||||
strcpy(sock_path, saddr.un.sun_path);
|
strcpy(sock_path, saddr.un.sun_path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -626,7 +632,7 @@ StreamServerPort(char *hostName, short portName, int *fdP)
|
|||||||
saddr.in.sin_port = htons(portName);
|
saddr.in.sin_port = htons(portName);
|
||||||
len = sizeof saddr.in;
|
len = sizeof saddr.in;
|
||||||
}
|
}
|
||||||
err = bind(fd, (struct sockaddr *) &saddr, len);
|
err = bind(fd, (struct sockaddr *) & saddr, len);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
{
|
{
|
||||||
sprintf(PQerrormsg,
|
sprintf(PQerrormsg,
|
||||||
@ -664,7 +670,8 @@ StreamServerPort(char *hostName, short portName, int *fdP)
|
|||||||
int
|
int
|
||||||
StreamConnection(int server_fd, Port *port)
|
StreamConnection(int server_fd, Port *port)
|
||||||
{
|
{
|
||||||
int len, addrlen;
|
int len,
|
||||||
|
addrlen;
|
||||||
int family = port->raddr.in.sin_family;
|
int family = port->raddr.in.sin_family;
|
||||||
|
|
||||||
/* accept connection (and fill in the client (remote) address) */
|
/* accept connection (and fill in the client (remote) address) */
|
||||||
@ -737,7 +744,8 @@ StreamClose(int sock)
|
|||||||
int
|
int
|
||||||
StreamOpen(char *hostName, short portName, Port *port)
|
StreamOpen(char *hostName, short portName, Port *port)
|
||||||
{
|
{
|
||||||
int len, err;
|
int len,
|
||||||
|
err;
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
extern int errno;
|
extern int errno;
|
||||||
|
|
||||||
@ -764,10 +772,10 @@ StreamOpen(char *hostName, short portName, Port *port)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
port->raddr.un.sun_family = AF_UNIX;
|
port->raddr.un.sun_family = AF_UNIX;
|
||||||
len = UNIXSOCK_PATH(port->raddr.un,portName);
|
len = UNIXSOCK_PATH(port->raddr.un, portName);
|
||||||
}
|
}
|
||||||
/* connect to the server */
|
/* connect to the server */
|
||||||
if ((port->sock=socket(port->raddr.in.sin_family, SOCK_STREAM, 0)) < 0)
|
if ((port->sock = socket(port->raddr.in.sin_family, SOCK_STREAM, 0)) < 0)
|
||||||
{
|
{
|
||||||
sprintf(PQerrormsg,
|
sprintf(PQerrormsg,
|
||||||
"FATAL: StreamOpen: socket() failed: errno=%d\n",
|
"FATAL: StreamOpen: socket() failed: errno=%d\n",
|
||||||
@ -776,7 +784,7 @@ StreamOpen(char *hostName, short portName, Port *port)
|
|||||||
pqdebug("%s", PQerrormsg);
|
pqdebug("%s", PQerrormsg);
|
||||||
return (STATUS_ERROR);
|
return (STATUS_ERROR);
|
||||||
}
|
}
|
||||||
err = connect(port->sock, (struct sockaddr*) &port->raddr, len);
|
err = connect(port->sock, (struct sockaddr *) & port->raddr, len);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
{
|
{
|
||||||
sprintf(PQerrormsg,
|
sprintf(PQerrormsg,
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.9 1997/11/07 20:51:36 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.10 1997/11/10 05:16:00 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -85,9 +85,9 @@ PacketReceive(Port *port, /* receive port */
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Assume port->nBytes is zero unless we were interrupted during
|
* Assume port->nBytes is zero unless we were interrupted during
|
||||||
* non-blocking I/O. This first recv() is to get the hdr
|
* non-blocking I/O. This first recv() is to get the hdr information
|
||||||
* information so we know how many bytes to read. Life would be very
|
* so we know how many bytes to read. Life would be very complicated
|
||||||
* complicated if we read too much data (buffering).
|
* if we read too much data (buffering).
|
||||||
*/
|
*/
|
||||||
tmp = ((Addr) buf) + port->nBytes;
|
tmp = ((Addr) buf) + port->nBytes;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user