From 938a64917dd8704ace3a740705fc23ea44c3c6be Mon Sep 17 00:00:00 2001
From: Andrey Arapov <andrey.arapov@nixaid.com>
Date: Sat, 10 Sep 2022 03:18:06 +0200
Subject: [PATCH] initdb: do not exit after warn_on_mount_point

---
 src/bin/initdb/initdb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index e00837ecac..59ce27e84c 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -2516,11 +2516,13 @@ create_data_directory(void)
 			if (ret != 4)
 				warn_on_mount_point(ret);
 			else
+			{
 				pg_log_error_hint("If you want to create a new database system, either remove or empty "
 								  "the directory \"%s\" or run %s "
 								  "with an argument other than \"%s\".",
 								  pg_data, progname, pg_data);
-			exit(1);			/* no further message needed */
+				exit(1);			/* no further message needed */
+			}
 
 		default:
 			/* Trouble accessing directory */
@@ -2588,9 +2590,11 @@ create_xlog_or_symlink(void)
 				if (ret != 4)
 					warn_on_mount_point(ret);
 				else
+				{
 					pg_log_error_hint("If you want to store the WAL there, either remove or empty the directory \"%s\".",
 									  xlog_dir);
-				exit(1);
+					exit(1);
+				}
 
 			default:
 				/* Trouble accessing directory */
-- 
2.34.1

