mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
pgindent run.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.29 2002/09/02 02:47:05 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.30 2002/09/04 20:31:31 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -115,7 +115,7 @@ ValidateBinary(char *path)
|
||||
is_x = buf.st_mode & S_IXGRP;
|
||||
if (!(is_r && is_x))
|
||||
elog(DEBUG2, "ValidateBinary: \"%s\" is not group read/execute",
|
||||
path);
|
||||
path);
|
||||
return is_x ? (is_r ? 0 : -2) : -1;
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ ValidateBinary(char *path)
|
||||
is_x = buf.st_mode & S_IXOTH;
|
||||
if (!(is_r && is_x))
|
||||
elog(DEBUG2, "ValidateBinary: \"%s\" is not other read/execute",
|
||||
path);
|
||||
path);
|
||||
return is_x ? (is_r ? 0 : -2) : -1;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ FindExec(char *full_path, const char *argv0, const char *binary_name)
|
||||
case 0: /* found ok */
|
||||
strncpy(full_path, buf, MAXPGPATH);
|
||||
elog(DEBUG1, "FindExec: found \"%s\" using PATH",
|
||||
full_path);
|
||||
full_path);
|
||||
free(path);
|
||||
return 0;
|
||||
case -1: /* wasn't even a candidate, keep looking */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.66 2002/08/12 00:36:11 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.67 2002/09/04 20:31:31 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Globals used all over the place should be declared here and not
|
||||
@@ -39,6 +39,7 @@ struct Port *MyProcPort;
|
||||
long MyCancelKey;
|
||||
|
||||
char *DataDir = NULL;
|
||||
|
||||
/*
|
||||
* The PGDATA directory user says to use, or defaults to via environment
|
||||
* variable. NULL if no option given and no environment variable set
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.95 2002/09/02 02:47:05 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.96 2002/09/04 20:31:31 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -176,8 +176,8 @@ SetDataDir(const char *dir)
|
||||
* generating funny-looking paths to individual files.
|
||||
*/
|
||||
newlen = strlen(new);
|
||||
if (newlen > 1 && new[newlen-1] == '/')
|
||||
new[newlen-1] = '\0';
|
||||
if (newlen > 1 && new[newlen - 1] == '/')
|
||||
new[newlen - 1] = '\0';
|
||||
|
||||
if (DataDir)
|
||||
free(DataDir);
|
||||
@@ -470,7 +470,6 @@ GetCharSetByHost(char *TableName, int host, const char *DataDir)
|
||||
pfree(ChArray[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CYR_RECODE */
|
||||
|
||||
|
||||
@@ -561,22 +560,22 @@ InitializeSessionUserId(const char *username)
|
||||
AuthenticatedUserId = usesysid;
|
||||
AuthenticatedUserIsSuperuser = ((Form_pg_shadow) GETSTRUCT(userTup))->usesuper;
|
||||
|
||||
SetSessionUserId(usesysid); /* sets CurrentUserId too */
|
||||
SetSessionUserId(usesysid); /* sets CurrentUserId too */
|
||||
|
||||
/* Record username as a config option too */
|
||||
SetConfigOption("session_authorization", username,
|
||||
PGC_BACKEND, PGC_S_OVERRIDE);
|
||||
|
||||
/*
|
||||
* Set up user-specific configuration variables. This is a good
|
||||
* place to do it so we don't have to read pg_shadow twice during
|
||||
* session startup.
|
||||
* Set up user-specific configuration variables. This is a good place
|
||||
* to do it so we don't have to read pg_shadow twice during session
|
||||
* startup.
|
||||
*/
|
||||
datum = SysCacheGetAttr(SHADOWNAME, userTup,
|
||||
Anum_pg_shadow_useconfig, &isnull);
|
||||
if (!isnull)
|
||||
{
|
||||
ArrayType *a = DatumGetArrayTypeP(datum);
|
||||
ArrayType *a = DatumGetArrayTypeP(datum);
|
||||
|
||||
ProcessGUCArray(a, PGC_S_USER);
|
||||
}
|
||||
@@ -952,7 +951,7 @@ RecordSharedMemoryInLockFile(unsigned long id1, unsigned long id2)
|
||||
ptr++;
|
||||
|
||||
/*
|
||||
* Append key information. Format to try to keep it the same length
|
||||
* Append key information. Format to try to keep it the same length
|
||||
* always (trailing junk won't hurt, but might confuse humans).
|
||||
*/
|
||||
sprintf(ptr, "%9lu %9lu\n", id1, id2);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.115 2002/09/03 21:45:42 petere Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.116 2002/09/04 20:31:31 momjian Exp $
|
||||
*
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
@@ -124,13 +124,14 @@ ReverifyMyDatabase(const char *name)
|
||||
name);
|
||||
|
||||
/*
|
||||
* OK, we're golden. Only other to-do item is to save the
|
||||
* encoding info out of the pg_database tuple.
|
||||
* OK, we're golden. Only other to-do item is to save the encoding
|
||||
* info out of the pg_database tuple.
|
||||
*/
|
||||
SetDatabaseEncoding(dbform->encoding);
|
||||
/* If we have no other source of client_encoding, use server encoding */
|
||||
SetConfigOption("client_encoding", GetDatabaseEncodingName(),
|
||||
PGC_BACKEND, PGC_S_DEFAULT);
|
||||
|
||||
/*
|
||||
* Set up database-specific configuration variables.
|
||||
*/
|
||||
@@ -143,7 +144,7 @@ ReverifyMyDatabase(const char *name)
|
||||
RelationGetDescr(pgdbrel), &isnull);
|
||||
if (!isnull)
|
||||
{
|
||||
ArrayType *a = DatumGetArrayTypeP(datum);
|
||||
ArrayType *a = DatumGetArrayTypeP(datum);
|
||||
|
||||
ProcessGUCArray(a, PGC_S_DATABASE);
|
||||
}
|
||||
@@ -277,8 +278,8 @@ InitPostgres(const char *dbname, const char *username)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Set up my per-backend PGPROC struct in shared memory. (We need to
|
||||
* know MyDatabaseId before we can do this, since it's entered into
|
||||
* Set up my per-backend PGPROC struct in shared memory. (We need
|
||||
* to know MyDatabaseId before we can do this, since it's entered into
|
||||
* the PGPROC struct.)
|
||||
*/
|
||||
InitProcess();
|
||||
@@ -304,9 +305,9 @@ InitPostgres(const char *dbname, const char *username)
|
||||
AmiTransactionOverride(bootstrap);
|
||||
|
||||
/*
|
||||
* Initialize the relation descriptor cache. This must create
|
||||
* at least the minimum set of "nailed-in" cache entries. No
|
||||
* catalog access happens here.
|
||||
* Initialize the relation descriptor cache. This must create at
|
||||
* least the minimum set of "nailed-in" cache entries. No catalog
|
||||
* access happens here.
|
||||
*/
|
||||
RelationCacheInitialize();
|
||||
|
||||
@@ -367,25 +368,26 @@ InitPostgres(const char *dbname, const char *username)
|
||||
ReverifyMyDatabase(dbname);
|
||||
|
||||
/*
|
||||
* Final phase of relation cache startup: write a new cache file
|
||||
* if necessary. This is done after ReverifyMyDatabase to avoid
|
||||
* writing a cache file into a dead database.
|
||||
* Final phase of relation cache startup: write a new cache file if
|
||||
* necessary. This is done after ReverifyMyDatabase to avoid writing
|
||||
* a cache file into a dead database.
|
||||
*/
|
||||
RelationCacheInitializePhase3();
|
||||
|
||||
/*
|
||||
* Initialize various default states that can't be set up until
|
||||
* we've selected the active user and done ReverifyMyDatabase.
|
||||
* Initialize various default states that can't be set up until we've
|
||||
* selected the active user and done ReverifyMyDatabase.
|
||||
*/
|
||||
|
||||
/* set default namespace search path */
|
||||
InitializeSearchPath();
|
||||
|
||||
/*
|
||||
* Set up process-exit callback to do pre-shutdown cleanup. This should
|
||||
* be last because we want shmem_exit to call this routine before the exit
|
||||
* callbacks that are registered by buffer manager, lock manager, etc.
|
||||
* We need to run this code before we close down database access!
|
||||
* Set up process-exit callback to do pre-shutdown cleanup. This
|
||||
* should be last because we want shmem_exit to call this routine
|
||||
* before the exit callbacks that are registered by buffer manager,
|
||||
* lock manager, etc. We need to run this code before we close down
|
||||
* database access!
|
||||
*/
|
||||
on_shmem_exit(ShutdownPostgres, 0);
|
||||
|
||||
@@ -395,10 +397,11 @@ InitPostgres(const char *dbname, const char *username)
|
||||
|
||||
/*
|
||||
* Check a normal user hasn't connected to a superuser reserved slot.
|
||||
* Do this here since we need the user information and that only happens
|
||||
* after we've started bringing the shared memory online. So we wait
|
||||
* until we've registered exit handlers and potentially shut an open
|
||||
* transaction down for an as safety conscious rejection as possible.
|
||||
* Do this here since we need the user information and that only
|
||||
* happens after we've started bringing the shared memory online. So
|
||||
* we wait until we've registered exit handlers and potentially shut
|
||||
* an open transaction down for an as safety conscious rejection as
|
||||
* possible.
|
||||
*/
|
||||
if (CountEmptyBackendSlots() < ReservedBackends && !superuser())
|
||||
elog(ERROR, "Non-superuser connection limit exceeded");
|
||||
|
||||
Reference in New Issue
Block a user