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

OK, folks, here is the pgindent output.

This commit is contained in:
Bruce Momjian
1998-09-01 04:40:42 +00:00
parent af74855a60
commit fa1a8d6a97
574 changed files with 26509 additions and 24033 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.30 1998/09/01 03:22:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.31 1998/09/01 04:28:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -140,7 +140,7 @@ pg_krb4_recvauth(Port *port)
return STATUS_ERROR;
}
#endif /* KRB4 */
#endif /* KRB4 */
#ifdef KRB5
@@ -320,7 +320,7 @@ pg_krb5_recvauth(Port *port)
return STATUS_ERROR;
}
#endif /* KRB5 */
#endif /* KRB5 */
/*
@@ -422,7 +422,7 @@ be_recvauth(Port *port)
*/
if (hba_getauthmethod(&port->raddr, port->user, port->database,
port->auth_arg, &port->auth_method) != STATUS_OK)
port->auth_arg, &port->auth_method) != STATUS_OK)
PacketSendError(&port->pktInfo, "Missing or mis-configured pg_hba.conf file");
else if (PG_PROTOCOL_MAJOR(port->proto) == 0)

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.25 1998/09/01 03:22:44 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.26 1998/09/01 04:28:46 momjian Exp $
*
* NOTES
* This should be moved to a more appropriate place. It is here
@@ -370,22 +370,23 @@ lo_export(Oid lobjId, text *filename)
/*
* lo_commit -
* prepares large objects for transaction commit [PA, 7/17/98]
* prepares large objects for transaction commit [PA, 7/17/98]
*/
void
void
_lo_commit(void)
{
int i;
int i;
MemoryContext currentContext;
if (fscxt == NULL)
return;
currentContext = MemoryContextSwitchTo((MemoryContext) fscxt);
for (i = 0; i < MAX_LOBJ_FDS; i++)
{
if (cookies[i] != NULL) inv_cleanindex(cookies[i]);
if (cookies[i] != NULL)
inv_cleanindex(cookies[i]);
}
MemoryContextSwitchTo(currentContext);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.34 1998/09/01 03:22:46 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.35 1998/09/01 04:28:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -161,7 +161,7 @@ process_hba_record(FILE *file, SockAddr *raddr, const char *user,
/*---------------------------------------------------------------------------
Process the non-comment record in the config file that is next on the file.
See if it applies to a connection to a host with IP address "*raddr"
to a database named "*database". If so, return *matches_p true
to a database named "*database". If so, return *matches_p true
and *userauth_p and *auth_arg as the values from the entry.
If not, leave *matches_p as it was. If the record has a syntax error,
return *error_p true, after issuing a message to stderr. If no error,
@@ -211,7 +211,7 @@ process_hba_record(FILE *file, SockAddr *raddr, const char *user,
*/
if ((strcmp(db, database) != 0 && strcmp(db, "all") != 0 &&
(strcmp(db, "sameuser") != 0 || strcmp(database, user) != 0)) ||
(strcmp(db, "sameuser") != 0 || strcmp(database, user) != 0)) ||
raddr->sa.sa_family != AF_UNIX)
return;
}
@@ -271,7 +271,7 @@ process_hba_record(FILE *file, SockAddr *raddr, const char *user,
*/
if ((strcmp(db, database) != 0 && strcmp(db, "all") != 0 &&
(strcmp(db, "sameuser") != 0 || strcmp(database, user) != 0)) ||
(strcmp(db, "sameuser") != 0 || strcmp(database, user) != 0)) ||
raddr->sa.sa_family != AF_INET ||
((file_ip_addr.s_addr ^ raddr->in.sin_addr.s_addr) & mask.s_addr) != 0x0000)
return;
@@ -679,7 +679,7 @@ parse_map_record(FILE *file,
return;
}
}
sprintf(PQerrormsg,"Incomplete line in pg_ident: %s",file_map);
sprintf(PQerrormsg, "Incomplete line in pg_ident: %s", file_map);
fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg);
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.16 1998/09/01 03:22:48 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.17 1998/09/01 04:28:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -481,7 +481,7 @@ PQftype(PortalBuffer *portal, int tuple_index, int field_number)
return -1;
if ((gbp = PQgroup(portal, tuple_index)) &&
in_range("PQftype: field number", field_number, 0, gbp->no_fields))
in_range("PQftype: field number", field_number, 0, gbp->no_fields))
return gbp->types[field_number].typid;
return -1;
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.52 1998/09/01 03:22:50 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.53 1998/09/01 04:28:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -60,8 +60,8 @@
#if defined(linux)
#ifndef SOMAXCONN
#define SOMAXCONN 5 /* from Linux listen(2) man page */
#endif /* SOMAXCONN */
#endif /* linux */
#endif /* SOMAXCONN */
#endif /* linux */
#include "miscadmin.h"
#include "libpq/pqsignal.h"
@@ -184,8 +184,9 @@ pq_getstr(char *s, int maxlen)
int c = '\0';
#ifdef MULTIBYTE
unsigned char *p, *ps;
int len;
unsigned char *p,
*ps;
int len;
ps = s;
len = maxlen;
@@ -203,11 +204,12 @@ pq_getstr(char *s, int maxlen)
#ifdef MULTIBYTE
p = pg_client_to_server(ps, len);
if (ps != p) { /* actual conversion has been done? */
strcpy(ps, p);
if (ps != p)
{ /* actual conversion has been done? */
strcpy(ps, p);
}
#endif
/* -----------------
* If EOF reached let caller know.
* (This will only happen if we hit EOF before the string
@@ -344,12 +346,12 @@ void
pq_putstr(char *s)
{
#ifdef MULTIBYTE
unsigned char *p;
unsigned char *p;
p = pg_server_to_client(s, strlen(s));
p = pg_server_to_client(s, strlen(s));
if (pqPutString(p, Pfout))
#else
if (pqPutString(s, Pfout))
if (pqPutString(s, Pfout))
#endif
{
sprintf(PQerrormsg,
@@ -555,16 +557,18 @@ StreamServerPort(char *hostName, short portName, int *fdP)
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.
* If the socket exists but nobody has an advisory lock on it we
* can safely delete the file.
*/
if ((lock_fd = open(sock_path, O_RDONLY|O_NONBLOCK, 0666)) >= 0) {
if (flock(lock_fd, LOCK_EX|LOCK_NB) == 0) {
if ((lock_fd = open(sock_path, O_RDONLY | O_NONBLOCK, 0666)) >= 0)
{
if (flock(lock_fd, LOCK_EX | LOCK_NB) == 0)
{
TPRINTF(TRACE_VERBOSE, "flock on %s, deleting", sock_path);
unlink(sock_path);
} else {
TPRINTF(TRACE_VERBOSE, "flock failed for %s", sock_path);
}
else
TPRINTF(TRACE_VERBOSE, "flock failed for %s", sock_path);
close(lock_fd);
}
}
@@ -584,8 +588,8 @@ StreamServerPort(char *hostName, short portName, int *fdP)
strcat(PQerrormsg,
"\tIs another postmaster already running on that port?\n");
if (family == AF_UNIX)
sprintf(PQerrormsg+strlen(PQerrormsg),
"\tIf not, remove socket node (%s) and retry.\n",
sprintf(PQerrormsg + strlen(PQerrormsg),
"\tIf not, remove socket node (%s) and retry.\n",
sock_path);
else
strcat(PQerrormsg, "\tIf not, wait a few seconds and retry.\n");
@@ -593,17 +597,18 @@ StreamServerPort(char *hostName, short portName, int *fdP)
return STATUS_ERROR;
}
if (family == AF_UNIX) {
if (family == AF_UNIX)
{
on_proc_exit(StreamDoUnlink, NULL);
/*
* Open the socket file and get an advisory lock on it.
* The lock_fd is left open to keep the lock.
* Open the socket file and get an advisory lock on it. The
* lock_fd is left open to keep the lock.
*/
if ((lock_fd = open(sock_path, O_RDONLY|O_NONBLOCK, 0666)) >= 0) {
if (flock(lock_fd, LOCK_EX|LOCK_NB) != 0) {
if ((lock_fd = open(sock_path, O_RDONLY | O_NONBLOCK, 0666)) >= 0)
{
if (flock(lock_fd, LOCK_EX | LOCK_NB) != 0)
TPRINTF(TRACE_VERBOSE, "flock error for %s", sock_path);
}
}
}
@@ -775,12 +780,13 @@ StreamOpen(char *hostName, short portName, Port *port)
void
pq_putncharlen(char *s, int n)
{
unsigned char *p;
int len;
unsigned char *p;
int len;
p = pg_server_to_client(s, n);
len = strlen(p);
pq_putint(len, sizeof(int));
pq_putnchar(p, len);
p = pg_server_to_client(s, n);
len = strlen(p);
pq_putint(len, sizeof(int));
pq_putnchar(p, len);
}
#endif

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.17 1998/08/25 21:22:27 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.18 1998/09/01 04:28:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -118,7 +118,8 @@ PacketReceiveFragment(Packet *pkt, int sock)
* Set up a packet write for the postmaster event loop.
*/
void PacketSendSetup(Packet *pkt, int nbytes, PacketDoneProc iodone, void *arg)
void
PacketSendSetup(Packet *pkt, int nbytes, PacketDoneProc iodone, void *arg)
{
pkt->len = (PacketLen) nbytes;
pkt->nrtodo = nbytes;

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqsignal.c,v 1.9 1998/09/01 03:22:52 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqsignal.c,v 1.10 1998/09/01 04:28:55 momjian Exp $
*
* NOTES
* This shouldn't be in libpq, but the monitor and some other
@@ -60,5 +60,5 @@ pqsignal(int signo, pqsigfunc func)
if (sigaction(signo, &act, &oact) < 0)
return SIG_ERR;
return oact.sa_handler;
#endif /* !USE_POSIX_SIGNALS */
#endif /* !USE_POSIX_SIGNALS */
}