From 884d904fb443629118cfc825e11a6e265ead7a30 Mon Sep 17 00:00:00 2001
From: "v.popolitov" <v.popolitov@postgrespro.ru>
Date: Thu, 30 Jul 2026 13:14:51 +0300
Subject: [PATCH] zic: fix PostgreSQL build failure on filesystems without hard
 link support

---
 src/timezone/zic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index cc6550bdb14..5ab884aa62d 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -1902,7 +1902,7 @@ dolink(char const *target, char const *linkname, bool staysymlink)
 			}
 			link_errno = errno;
 		}
-		if (link_errno == EXDEV || link_errno == ENOTSUP)
+		if (link_errno == EXDEV || link_errno == ENOTSUP || link_errno == EINVAL)
 			break;
 
 		if (link_errno == EEXIST)
@@ -1983,7 +1983,7 @@ dolink(char const *target, char const *linkname, bool staysymlink)
 				putc(c, tp);
 			close_file(tp, directory, linkname, tempname);
 			close_file(fp, directory, target, NULL);
-			if (link_errno != ENOTSUP)
+			if (link_errno != ENOTSUP && link_errno != EINVAL)
 				warning(_("copy used because hard link failed: %s"),
 						strerror(link_errno));
 #ifdef HAVE_SYMLINK
-- 
2.52.0.windows.1

