@@ -6457,9 +6457,9 @@ flatten_set_variable_args(const char *name, List *args)
64576457}
64586458
64596459/*
6460- * Writes updated configuration parameter values into
6461- * postgresql.auto.conf.temp file. It traverses the list of parameters
6462- * and quote the string values before writing them to temporaray file .
6460+ * Write updated configuration parameter values into a temporary file.
6461+ * This function traverses the list of parameters and quotes the string
6462+ * values before writing them.
64636463 */
64646464static void
64656465write_auto_conf_file (int fd , const char * filename , ConfigVariable * * head_p )
@@ -6468,8 +6468,8 @@ write_auto_conf_file(int fd, const char *filename, ConfigVariable **head_p)
64686468 StringInfoData buf ;
64696469
64706470 initStringInfo (& buf );
6471- appendStringInfoString (& buf , "# Do not edit this file manually! \n" );
6472- appendStringInfoString (& buf , "# It will be overwritten by ALTER SYSTEM command. \n" );
6471+ appendStringInfoString (& buf , "# Do not edit this file manually!\n" );
6472+ appendStringInfoString (& buf , "# It will be overwritten by ALTER SYSTEM command.\n" );
64736473
64746474 /*
64756475 * write the file header message before contents, so that if there is no
@@ -6517,7 +6517,7 @@ write_auto_conf_file(int fd, const char *filename, ConfigVariable **head_p)
65176517
65186518/*
65196519 * This function takes list of all configuration parameters in
6520- * postgresql.auto.conf and parameter to be updated as input arguments and
6520+ * PG_AUTOCONF_FILENAME and parameter to be updated as input arguments and
65216521 * replace the updated configuration parameter value in a list. If the
65226522 * parameter to be updated is new then it is appended to the list of
65236523 * parameters.
@@ -6595,13 +6595,12 @@ replace_auto_config_value(ConfigVariable **head_p, ConfigVariable **tail_p,
65956595 * and write them all to the automatic configuration file.
65966596 *
65976597 * The configuration parameters are written to a temporary
6598- * file then renamed to the final name. The template for the
6599- * temporary file is postgresql.auto.conf.temp.
6598+ * file then renamed to the final name.
66006599 *
66016600 * An LWLock is used to serialize writing to the same file.
66026601 *
66036602 * In case of an error, we leave the original automatic
6604- * configuration file (postgresql.auto.conf ) intact.
6603+ * configuration file (PG_AUTOCONF_FILENAME ) intact.
66056604 */
66066605void
66076606AlterSystemSetConfigFile (AlterSystemStmt * altersysstmt )
@@ -6664,8 +6663,8 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
66646663
66656664
66666665 /*
6667- * Use data directory as reference path for postgresql.auto.conf and it's
6668- * corresponding temp file
6666+ * Use data directory as reference path for PG_AUTOCONF_FILENAME and its
6667+ * corresponding temporary file.
66696668 */
66706669 join_path_components (AutoConfFileName , data_directory , PG_AUTOCONF_FILENAME );
66716670 canonicalize_path (AutoConfFileName );
@@ -6674,10 +6673,10 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
66746673 "temp" );
66756674
66766675 /*
6677- * one backend is allowed to operate on postgresql.auto.conf file, to
6676+ * One backend is allowed to operate on file PG_AUTOCONF_FILENAME , to
66786677 * ensure that we need to update the contents of the file with
66796678 * AutoFileLock. To ensure crash safety, first the contents are written to
6680- * temporary file and then rename it to postgresql.auto.conf . In case
6679+ * a temporary file which is then renameed to PG_AUTOCONF_FILENAME . In case
66816680 * there exists a temp file from previous crash, that can be reused.
66826681 */
66836682
@@ -6694,14 +6693,14 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
66946693 {
66956694 if (stat (AutoConfFileName , & st ) == 0 )
66966695 {
6697- /* open postgresql.auto.conf file */
6696+ /* open file PG_AUTOCONF_FILENAME */
66986697 infile = AllocateFile (AutoConfFileName , "r" );
66996698 if (infile == NULL )
67006699 ereport (ERROR ,
67016700 (errmsg ("failed to open auto conf file \"%s\": %m " ,
67026701 AutoConfFileName )));
67036702
6704- /* Parse the postgresql.auto.conf file */
6703+ /* parse it */
67056704 ParseConfigFp (infile , AutoConfFileName , 0 , LOG , & head , & tail );
67066705
67076706 FreeFile (infile );
@@ -6713,7 +6712,7 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
67136712 */
67146713 replace_auto_config_value (& head , & tail , AutoConfFileName , name , value );
67156714
6716- /* Write and sync the New contents to postgresql.auto.conf.temp file */
6715+ /* Write and sync the new contents to the temporary file */
67176716 write_auto_conf_file (Tmpfd , AutoConfTmpFileName , & head );
67186717
67196718 close (Tmpfd );
0 commit comments