@@ -98,7 +98,7 @@ parseCommandLine(int argc, char *argv[])
9898pg_fatal ("%s: cannot be run as root\n" ,os_info .progname );
9999
100100if ((log_opts .internal = fopen_priv (INTERNAL_LOG_FILE ,"a" ))== NULL )
101- pg_fatal ("cannot write to log file%s \n" ,INTERNAL_LOG_FILE );
101+ pg_fatal ("could not write to log file\"%s\" \n" ,INTERNAL_LOG_FILE );
102102
103103while ((option = getopt_long (argc ,argv ,"d:D:b:B:cj:ko:O:p:P:rU:v" ,
104104long_options ,& optindex ))!= -1 )
@@ -214,7 +214,7 @@ parseCommandLine(int argc, char *argv[])
214214for (filename = output_files ;* filename != NULL ;filename ++ )
215215{
216216if ((fp = fopen_priv (* filename ,"a" ))== NULL )
217- pg_fatal ("cannot write to log file%s \n" ,* filename );
217+ pg_fatal ("could not write to log file\"%s\" \n" ,* filename );
218218
219219/* Start with newline because we might be appending to a file. */
220220fprintf (fp ,"\n"
@@ -262,7 +262,7 @@ parseCommandLine(int argc, char *argv[])
262262canonicalize_path (new_cluster_pgdata );
263263
264264if (!getcwd (cwd ,MAXPGPATH ))
265- pg_fatal ("cannot find current directory\n" );
265+ pg_fatal ("could not determine current directory\n" );
266266canonicalize_path (cwd );
267267if (path_is_prefix_of_path (new_cluster_pgdata ,cwd ))
268268pg_fatal ("cannot run pg_upgrade from inside the new cluster data directory on Windows\n" );
@@ -459,7 +459,7 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
459459/* Use the current directory for the socket */
460460cluster -> sockdir = pg_malloc (MAXPGPATH );
461461if (!getcwd (cluster -> sockdir ,MAXPGPATH ))
462- pg_fatal ("cannot find current directory\n" );
462+ pg_fatal ("could not determine current directory\n" );
463463}
464464else
465465{
@@ -477,14 +477,16 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
477477snprintf (filename ,sizeof (filename ),"%s/postmaster.pid" ,
478478cluster -> pgdata );
479479if ((fp = fopen (filename ,"r" ))== NULL )
480- pg_fatal ("Cannot open file %s: %m\n" ,filename );
480+ pg_fatal ("could not open file \"%s\": %s\n" ,
481+ filename ,strerror (errno ));
481482
482483for (lineno = 1 ;
483484lineno <=Max (LOCK_FILE_LINE_PORT ,LOCK_FILE_LINE_SOCKET_DIR );
484485lineno ++ )
485486{
486487if (fgets (line ,sizeof (line ),fp )== NULL )
487- pg_fatal ("Cannot read line %d from %s: %m\n" ,lineno ,filename );
488+ pg_fatal ("could not read line %d from file \"%s\": %s\n" ,
489+ lineno ,filename ,strerror (errno ));
488490
489491/* potentially overwrite user-supplied value */
490492if (lineno == LOCK_FILE_LINE_PORT )
@@ -501,7 +503,7 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
501503
502504/* warn of port number correction */
503505if (orig_port != DEF_PGUPORT && old_cluster .port != orig_port )
504- pg_log (PG_WARNING ,"User -supplied old port number %hu corrected to %hu\n" ,
506+ pg_log (PG_WARNING ,"user -supplied old port number %hu corrected to %hu\n" ,
505507orig_port ,cluster -> port );
506508}
507509}