Also adjust some error message capitalization for consistency.
if ((lib_test = fopen(libfile, "r")) == NULL)
pg_log(PG_FATAL,
- "\npg_upgrade_support%s must be created and installed in %s\n", DLSUFFIX, libfile);
+ "pg_upgrade_support%s must be created and installed in %s\n", DLSUFFIX, libfile);
else
fclose(lib_test);
if (result != 0)
{
pg_log(throw_error ? PG_FATAL : PG_INFO,
- "\nThere were problems executing %s\n", cmd);
+ "There were problems executing %s\n", cmd);
return 1;
}
if ((fd = open(path, O_RDONLY, 0)) < 0)
{
if (errno != ENOENT)
- pg_log(PG_FATAL, "\ncould not open file \"%s\" for reading\n",
+ pg_log(PG_FATAL, "could not open file \"%s\" for reading\n",
path);
return false;
requiredSubdirs[subdirnum]);
if (stat(subDirName, &statBuf) != 0)
- report_status(PG_FATAL, "check for %s failed: %s",
+ report_status(PG_FATAL, "check for %s failed: %s\n",
requiredSubdirs[subdirnum], getErrorText(errno));
else if (!S_ISDIR(statBuf.st_mode))
- report_status(PG_FATAL, "%s is not a directory",
+ report_status(PG_FATAL, "%s is not a directory\n",
requiredSubdirs[subdirnum]);
}
}
size_t entrysize;
if ((dirdesc = opendir(dirname)) == NULL)
- pg_log(PG_FATAL, "Could not open directory \"%s\": %m\n", dirname);
+ pg_log(PG_FATAL, "could not open directory \"%s\": %m\n", dirname);
*namelist = NULL;
*/
/* truncate */
if ((log_opts.fd = fopen(log_opts.filename, "w")) == NULL)
- pg_log(PG_FATAL, "Cannot write to log file %s\n", log_opts.filename);
+ pg_log(PG_FATAL, "cannot write to log file %s\n", log_opts.filename);
fclose(log_opts.fd);
if ((log_opts.fd = fopen(log_opts.filename, "a")) == NULL)
- pg_log(PG_FATAL, "Cannot write to log file %s\n", log_opts.filename);
+ pg_log(PG_FATAL, "cannot write to log file %s\n", log_opts.filename);
}
else
log_opts.filename = strdup(DEVNULL);
{
log_opts.debug_fd = fopen(DEVTTY, "w");
if (!log_opts.debug_fd)
- pg_log(PG_FATAL, "Cannot write to terminal\n");
+ pg_log(PG_FATAL, "cannot write to terminal\n");
}
/* Get values from env if not already set */
snprintf(old_clog_path, sizeof(old_clog_path), "%s/pg_clog", old_cluster.pgdata);
snprintf(new_clog_path, sizeof(new_clog_path), "%s/pg_clog", new_cluster.pgdata);
if (!rmtree(new_clog_path, true))
- pg_log(PG_FATAL, "Unable to delete directory %s\n", new_clog_path);
+ pg_log(PG_FATAL, "unable to delete directory %s\n", new_clog_path);
check_ok();
prep_status("Copying old commit clogs to new server");
if (conn)
PQfinish(conn);
pg_log(PG_FATAL, "unable to connect to %s postmaster started with the command: %s\n"
- "Perhaps pg_hba.conf was not set to \"trust\".",
+ "Perhaps pg_hba.conf was not set to \"trust\".\n",
CLUSTER_NAME(cluster), cmd);
}
PQfinish(conn);
* if(( message = flarbFiles(fileCount)) == NULL)
* report_status(PG_REPORT, "ok" );
* else
- * pg_log(PG_FATAL, "failed - %s", message );
+ * pg_log(PG_FATAL, "failed - %s\n", message );
*/
void
prep_status(const char *fmt,...)
break;
case PG_FATAL:
- printf("%s", "\n");
- printf("%s", _(message));
+ printf("\n%s", _(message));
printf("Failure, exiting\n");
exit(1);
break;
if (!check_mode)
{
if (script == NULL && (script = fopen(output_path, "w")) == NULL)
- pg_log(PG_FATAL, "Could not create necessary file: %s\n", output_path);
+ pg_log(PG_FATAL, "could not create necessary file: %s\n", output_path);
fprintf(script, "\\connect %s\n",
quote_identifier(active_db->db_name));
fprintf(script,
{
found = true;
if (script == NULL && (script = fopen(output_path, "w")) == NULL)
- pg_log(PG_FATAL, "Could not create necessary file: %s\n", output_path);
+ pg_log(PG_FATAL, "could not create necessary file: %s\n", output_path);
if (!db_used)
{
fprintf(script, "Database: %s\n", active_db->db_name);
{
found = true;
if (script == NULL && (script = fopen(output_path, "w")) == NULL)
- pg_log(PG_FATAL, "Could not create necessary file: %s\n", output_path);
+ pg_log(PG_FATAL, "could not create necessary file: %s\n", output_path);
if (!db_used)
{
fprintf(script, "Database: %s\n", active_db->db_name);
if (!check_mode)
{
if (script == NULL && (script = fopen(output_path, "w")) == NULL)
- pg_log(PG_FATAL, "Could not create necessary file: %s\n", output_path);
+ pg_log(PG_FATAL, "could not create necessary file: %s\n", output_path);
if (!db_used)
{
fprintf(script, "\\connect %s\n\n",
if (!check_mode)
{
if (script == NULL && (script = fopen(output_path, "w")) == NULL)
- pg_log(PG_FATAL, "Could not create necessary file: %s\n", output_path);
+ pg_log(PG_FATAL, "could not create necessary file: %s\n", output_path);
if (!db_used)
{
fprintf(script, "\\connect %s\n",
if (!check_mode)
{
if (script == NULL && (script = fopen(output_path, "w")) == NULL)
- pg_log(PG_FATAL, "Could not create necessary file: %s\n", output_path);
+ pg_log(PG_FATAL, "could not create necessary file: %s\n", output_path);
if (!db_used)
{
fprintf(script, "\\connect %s\n",
found = true;
if (script == NULL && (script = fopen(output_path, "w")) == NULL)
- pg_log(PG_FATAL, "Could not create necessary file: %s\n", output_path);
+ pg_log(PG_FATAL, "could not create necessary file: %s\n", output_path);
if (!db_used)
{
fprintf(script, "\\connect %s\n\n",