mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	pg_ctl: Write error messages to stderr
This commit is contained in:
		@@ -256,25 +256,24 @@ get_pgpid(bool is_status_request)
 | 
				
			|||||||
	if (stat(pg_data, &statbuf) != 0)
 | 
						if (stat(pg_data, &statbuf) != 0)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		if (errno == ENOENT)
 | 
							if (errno == ENOENT)
 | 
				
			||||||
			printf(_("%s: directory \"%s\" does not exist\n"), progname,
 | 
								write_stderr(_("%s: directory \"%s\" does not exist\n"), progname,
 | 
				
			||||||
				   pg_data);
 | 
											 pg_data);
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			printf(_("%s: cannot access directory \"%s\"\n"), progname,
 | 
								write_stderr(_("%s: could not access directory \"%s\": %s\n"), progname,
 | 
				
			||||||
				   pg_data);
 | 
											 pg_data, strerror(errno));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/*
 | 
							/*
 | 
				
			||||||
		 * The Linux Standard Base Core Specification 3.1 says this should
 | 
							 * The Linux Standard Base Core Specification 3.1 says this should
 | 
				
			||||||
		 * return '4, program or service status is unknown'
 | 
							 * return '4, program or service status is unknown'
 | 
				
			||||||
		 * https://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-g
 | 
							 * https://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
 | 
				
			||||||
		 * eneric/iniscrptact.html
 | 
					 | 
				
			||||||
		 */
 | 
							 */
 | 
				
			||||||
		exit(is_status_request ? 4 : 1);
 | 
							exit(is_status_request ? 4 : 1);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (stat(version_file, &statbuf) != 0 && errno == ENOENT)
 | 
						if (stat(version_file, &statbuf) != 0 && errno == ENOENT)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		printf(_("%s: directory \"%s\" is not a database cluster directory\n"),
 | 
							write_stderr(_("%s: directory \"%s\" is not a database cluster directory\n"),
 | 
				
			||||||
			   progname, pg_data);
 | 
										 progname, pg_data);
 | 
				
			||||||
		exit(is_status_request ? 4 : 1);
 | 
							exit(is_status_request ? 4 : 1);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user