diff options
| author | Bruce Momjian | 2014-05-06 16:12:18 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2014-05-06 16:12:18 +0000 |
| commit | 0a7832005792fa6dad171f9cadb8d587fe0dd800 (patch) | |
| tree | 365cfc42c521a52607e41394b08ef44d338d8fc1 /src/bin/initdb | |
| parent | fb85cd4320414c3f6e9c8bc69ec944200ae1e493 (diff) | |
pgindent run for 9.4
This includes removing tabs after periods in C comments, which was
applied to back branches, so this change should not effect backpatching.
Diffstat (limited to 'src/bin/initdb')
| -rw-r--r-- | src/bin/initdb/findtimezone.c | 6 | ||||
| -rw-r--r-- | src/bin/initdb/initdb.c | 25 | ||||
| -rw-r--r-- | src/bin/initdb/t/001_initdb.pl | 29 |
3 files changed, 34 insertions, 26 deletions
diff --git a/src/bin/initdb/findtimezone.c b/src/bin/initdb/findtimezone.c index bc1f2c2c973..f0255d85af4 100644 --- a/src/bin/initdb/findtimezone.c +++ b/src/bin/initdb/findtimezone.c @@ -52,7 +52,7 @@ pg_TZDIR(void) * This is simpler than the backend function of the same name because * we assume that the input string has the correct case already, so there * is no need for case-folding. (This is obviously true if we got the file - * name from the filesystem to start with. The only other place it can come + * name from the filesystem to start with. The only other place it can come * from is the environment variable TZ, and there seems no need to allow * case variation in that; other programs aren't likely to.) * @@ -471,7 +471,7 @@ identify_system_timezone(void) return resultbuf; /* - * Did not find the timezone. Fallback to use a GMT zone. Note that the + * Did not find the timezone. Fallback to use a GMT zone. Note that the * Olson timezone database names the GMT-offset zones in POSIX style: plus * is west of Greenwich. It's unfortunate that this is opposite of SQL * conventions. Should we therefore change the names? Probably not... @@ -490,7 +490,7 @@ identify_system_timezone(void) * Recursively scan the timezone database looking for the best match to * the system timezone behavior. * - * tzdir points to a buffer of size MAXPGPATH. On entry, it holds the + * tzdir points to a buffer of size MAXPGPATH. On entry, it holds the * pathname of a directory containing TZ files. We internally modify it * to hold pathnames of sub-directories and files, but must restore it * to its original contents before exit. diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 83b7f6e24d8..2a51916106b 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -18,7 +18,7 @@ * to produce a new database. * * For largely-historical reasons, the template1 database is the one built - * by the basic bootstrap process. After it is complete, template0 and + * by the basic bootstrap process. After it is complete, template0 and * the default database, postgres, are made just by copying template1. * * To create template1, we run the postgres (backend) program in bootstrap @@ -581,7 +581,7 @@ walkdir(char *path, void (*action) (char *fname, bool isdir)) /* * It's important to fsync the destination directory itself as individual * file fsyncs don't guarantee that the directory entry for the file is - * synced. Recent versions of ext4 have made the window much wider but + * synced. Recent versions of ext4 have made the window much wider but * it's been an issue for ext3 and other filesystems in the past. */ (*action) (path, true); @@ -614,7 +614,7 @@ pre_sync_fname(char *fname, bool isdir) } /* - * Prefer sync_file_range, else use posix_fadvise. We ignore any error + * Prefer sync_file_range, else use posix_fadvise. We ignore any error * here since this operation is only a hint anyway. */ #if defined(HAVE_SYNC_FILE_RANGE) @@ -772,7 +772,7 @@ exit_nicely(void) static char * get_id(void) { - const char *username; + const char *username; #ifndef WIN32 if (geteuid() == 0) /* 0 is root's uid */ @@ -1057,13 +1057,13 @@ static char * choose_dsm_implementation(void) { #ifdef HAVE_SHM_OPEN - int ntries = 10; + int ntries = 10; while (ntries > 0) { - uint32 handle; - char name[64]; - int fd; + uint32 handle; + char name[64]; + int fd; handle = random(); snprintf(name, 64, "/PostgreSQL.%u", handle); @@ -1976,7 +1976,7 @@ setup_collation(void) */ if (normalize_locale_name(alias, localebuf)) { - char *quoted_alias = escape_quotes(alias); + char *quoted_alias = escape_quotes(alias); PG_CMD_PRINTF3("INSERT INTO tmp_pg_collation VALUES (E'%s', E'%s', %d);\n", quoted_alias, quoted_locale, enc); @@ -1992,7 +1992,7 @@ setup_collation(void) * When copying collations to the final location, eliminate aliases that * conflict with an existing locale name for the same encoding. For * example, "br_FR.iso88591" is normalized to "br_FR", both for encoding - * LATIN1. But the unnormalized locale "br_FR" already exists for LATIN1. + * LATIN1. But the unnormalized locale "br_FR" already exists for LATIN1. * Prefer the alias that matches the OS locale name, else the first locale * name by sort order (arbitrary choice to be deterministic). * @@ -2099,7 +2099,7 @@ setup_dictionary(void) /* * Set up privileges * - * We mark most system catalogs as world-readable. We don't currently have + * We mark most system catalogs as world-readable. We don't currently have * to touch functions, languages, or databases, because their default * permissions are OK. * @@ -2532,7 +2532,7 @@ locale_date_order(const char *locale) * Is the locale name valid for the locale category? * * If successful, and canonname isn't NULL, a malloc'd copy of the locale's - * canonical name is stored there. This is especially useful for figuring out + * canonical name is stored there. This is especially useful for figuring out * what locale name "" means (ie, the environment value). (Actually, * it seems that on most implementations that's the only thing it's good for; * we could wish that setlocale gave back a canonically spelled version of @@ -2886,6 +2886,7 @@ void get_restricted_token(void) { #ifdef WIN32 + /* * Before we execute another program, make sure that we are running with a * restricted token. If not, re-execute ourselves with one. diff --git a/src/bin/initdb/t/001_initdb.pl b/src/bin/initdb/t/001_initdb.pl index ad6d74cc0dd..a7bea76f529 100644 --- a/src/bin/initdb/t/001_initdb.pl +++ b/src/bin/initdb/t/001_initdb.pl @@ -9,29 +9,36 @@ program_help_ok('initdb'); program_version_ok('initdb'); program_options_handling_ok('initdb'); -command_ok(['initdb', "$tempdir/data"], 'basic initdb'); -command_fails(['initdb', "$tempdir/data"], 'existing data directory'); -command_ok(['initdb', '-N', "$tempdir/data2"], 'nosync'); -command_ok(['initdb', '-S', "$tempdir/data2"], 'sync only'); -command_fails(['initdb', '-S', "$tempdir/data3"], 'sync missing data directory'); +command_ok([ 'initdb', "$tempdir/data" ], 'basic initdb'); +command_fails([ 'initdb', "$tempdir/data" ], 'existing data directory'); +command_ok([ 'initdb', '-N', "$tempdir/data2" ], 'nosync'); +command_ok([ 'initdb', '-S', "$tempdir/data2" ], 'sync only'); +command_fails([ 'initdb', '-S', "$tempdir/data3" ], + 'sync missing data directory'); mkdir "$tempdir/data4" or BAIL_OUT($!); -command_ok(['initdb', "$tempdir/data4"], 'existing empty data directory'); +command_ok([ 'initdb', "$tempdir/data4" ], 'existing empty data directory'); system_or_bail "rm -rf $tempdir/*"; -command_ok(['initdb', "$tempdir/data", '-X', "$tempdir/pgxlog"], 'separate xlog directory'); +command_ok([ 'initdb', "$tempdir/data", '-X', "$tempdir/pgxlog" ], + 'separate xlog directory'); system_or_bail "rm -rf $tempdir/*"; -command_fails(['initdb', "$tempdir/data", '-X', 'pgxlog'], 'relative xlog directory not allowed'); +command_fails( + [ 'initdb', "$tempdir/data", '-X', 'pgxlog' ], + 'relative xlog directory not allowed'); system_or_bail "rm -rf $tempdir/*"; mkdir "$tempdir/pgxlog"; -command_ok(['initdb', "$tempdir/data", '-X', "$tempdir/pgxlog"], 'existing empty xlog directory'); +command_ok([ 'initdb', "$tempdir/data", '-X', "$tempdir/pgxlog" ], + 'existing empty xlog directory'); system_or_bail "rm -rf $tempdir/*"; mkdir "$tempdir/pgxlog"; mkdir "$tempdir/pgxlog/lost+found"; -command_fails(['initdb', "$tempdir/data", '-X', "$tempdir/pgxlog"], 'existing nonempty xlog directory'); +command_fails([ 'initdb', "$tempdir/data", '-X', "$tempdir/pgxlog" ], + 'existing nonempty xlog directory'); system_or_bail "rm -rf $tempdir/*"; -command_ok(['initdb', "$tempdir/data", '-T', 'german'], 'select default dictionary'); +command_ok([ 'initdb', "$tempdir/data", '-T', 'german' ], + 'select default dictionary'); |
