initdb.diff
text/x-diff
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/bin/initdb/initdb.c | 0 | 0 |
commit 26374f2a0fc02b76a91b7565e908dbae99a3b5f9
Author: Bruce Momjian <bruce@momjian.us>
Date: Mon Dec 3 23:22:56 2012 -0500
In initdb.c, rename some newly created functions, and move the directory
creation and xlog symlink creation to separate functions.
Per suggestions from Andrew Dunstan.
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
new file mode 100644
index 8c0a9f4..d44281b
*** a/src/bin/initdb/initdb.c
--- b/src/bin/initdb/initdb.c
*************** void setup_pgdata(void);
*** 255,263 ****
void setup_bin_paths(const char *argv0);
void setup_data_file_paths(void);
void setup_locale_encoding(void);
! void setup_signals_and_umask(void);
void setup_text_search(void);
! void process(const char *argv0);
#ifdef WIN32
--- 255,265 ----
void setup_bin_paths(const char *argv0);
void setup_data_file_paths(void);
void setup_locale_encoding(void);
! void setup_signals(void);
void setup_text_search(void);
! void create_data_directory(void);
! void create_xlog_symlink(void);
! void initialize_data_directory(void);
#ifdef WIN32
*************** setup_text_search(void)
*** 3164,3170 ****
void
! setup_signals_and_umask(void)
{
/* some of these are not valid on Windows */
#ifdef SIGHUP
--- 3166,3172 ----
void
! setup_signals(void)
{
/* some of these are not valid on Windows */
#ifdef SIGHUP
*************** setup_signals_and_umask(void)
*** 3184,3202 ****
#ifdef SIGPIPE
pqsignal(SIGPIPE, SIG_IGN);
#endif
-
- umask(S_IRWXG | S_IRWXO);
}
void
! process(const char *argv0)
{
- int i;
- char bin_dir[MAXPGPATH];
-
- setup_signals_and_umask();
-
switch (pg_check_dir(pg_data))
{
case 0:
--- 3186,3197 ----
#ifdef SIGPIPE
pqsignal(SIGPIPE, SIG_IGN);
#endif
}
void
! create_data_directory(void)
{
switch (pg_check_dir(pg_data))
{
case 0:
*************** process(const char *argv0)
*** 3249,3255 ****
--- 3244,3255 ----
progname, pg_data, strerror(errno));
exit_nicely();
}
+ }
+
+ void
+ create_xlog_symlink(void)
+ {
/* Create transaction log symlink, if required */
if (strcmp(xlog_dir, "") != 0)
{
*************** process(const char *argv0)
*** 3336,3341 ****
--- 3336,3356 ----
exit_nicely();
#endif
}
+ }
+
+
+ void
+ initialize_data_directory(void)
+ {
+ int i;
+
+ setup_signals();
+
+ umask(S_IRWXG | S_IRWXO);
+
+ create_data_directory();
+
+ create_xlog_symlink();
/* Create required subdirectories */
printf(_("creating subdirectories ... "));
*************** process(const char *argv0)
*** 3404,3422 ****
if (authwarning != NULL)
fprintf(stderr, "%s", authwarning);
-
- /* Get directory specification used to start this executable */
- strlcpy(bin_dir, argv0, sizeof(bin_dir));
- get_parent_directory(bin_dir);
-
- printf(_("\nSuccess. You can now start the database server using:\n\n"
- " %s%s%spostgres%s -D %s%s%s\n"
- "or\n"
- " %s%s%spg_ctl%s -D %s%s%s -l logfile start\n\n"),
- QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
- QUOTE_PATH, pgdata_native, QUOTE_PATH,
- QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
- QUOTE_PATH, pgdata_native, QUOTE_PATH);
}
--- 3419,3424 ----
*************** main(int argc, char *argv[])
*** 3459,3464 ****
--- 3461,3467 ----
int c;
int option_index;
char *effective_user;
+ char bin_dir[MAXPGPATH];
progname = get_progname(argv[0]);
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("initdb"));
*************** main(int argc, char *argv[])
*** 3642,3648 ****
printf("\n");
! process(argv[0]);
return 0;
}
--- 3645,3664 ----
printf("\n");
! initialize_data_directory();
+ /* Get directory specification used to start this executable */
+ strlcpy(bin_dir, argv[0], sizeof(bin_dir));
+ get_parent_directory(bin_dir);
+
+ printf(_("\nSuccess. You can now start the database server using:\n\n"
+ " %s%s%spostgres%s -D %s%s%s\n"
+ "or\n"
+ " %s%s%spg_ctl%s -D %s%s%s -l logfile start\n\n"),
+ QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
+ QUOTE_PATH, pgdata_native, QUOTE_PATH,
+ QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
+ QUOTE_PATH, pgdata_native, QUOTE_PATH);
+
return 0;
}