mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Improve messages for too many private files/dirs. Per Alexey Parshin.
This commit is contained in:
		@@ -1398,7 +1398,8 @@ AllocateFile(const char *name, const char *mode)
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (numAllocatedDescs >= MAX_ALLOCATED_DESCS ||
 | 
						if (numAllocatedDescs >= MAX_ALLOCATED_DESCS ||
 | 
				
			||||||
		numAllocatedDescs >= max_safe_fds - 1)
 | 
							numAllocatedDescs >= max_safe_fds - 1)
 | 
				
			||||||
		elog(ERROR, "too many private files demanded");
 | 
							elog(ERROR, "exceeded MAX_ALLOCATED_DESCS while trying to open file \"%s\"",
 | 
				
			||||||
 | 
								 name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TryAgain:
 | 
					TryAgain:
 | 
				
			||||||
	if ((file = fopen(name, mode)) != NULL)
 | 
						if ((file = fopen(name, mode)) != NULL)
 | 
				
			||||||
@@ -1513,7 +1514,8 @@ AllocateDir(const char *dirname)
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (numAllocatedDescs >= MAX_ALLOCATED_DESCS ||
 | 
						if (numAllocatedDescs >= MAX_ALLOCATED_DESCS ||
 | 
				
			||||||
		numAllocatedDescs >= max_safe_fds - 1)
 | 
							numAllocatedDescs >= max_safe_fds - 1)
 | 
				
			||||||
		elog(ERROR, "too many private dirs demanded");
 | 
							elog(ERROR, "exceeded MAX_ALLOCATED_DESCS while trying to open directory \"%s\"",
 | 
				
			||||||
 | 
								 dirname);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TryAgain:
 | 
					TryAgain:
 | 
				
			||||||
	if ((dir = opendir(dirname)) != NULL)
 | 
						if ((dir = opendir(dirname)) != NULL)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user