From df0399a5537fd876c7f8cde65307bf8b84b3b024 Mon Sep 17 00:00:00 2001
From: Hari <haribabuk@fast.au.fujitsu.com>
Date: Fri, 14 Jul 2017 11:34:21 +1000
Subject: [PATCH 2/2] Replace setmode with _setmode function

The Posix setmode function is deprecated in windows
and suggested to use _setmode function[1]. There is no
functionality change, just to make sure that we are
using _setmode in every place.

[1] - https://docs.microsoft.com/en-gb/cpp/c-runtime-library/reference/posix-setmode
---
 src/bin/pg_dump/pg_backup_archiver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index c24a0f0..b9d063a 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -2346,9 +2346,9 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
 		(AH->fSpec == NULL || strcmp(AH->fSpec, "") == 0))
 	{
 		if (mode == archModeWrite)
-			setmode(fileno(stdout), O_BINARY);
+			_setmode(fileno(stdout), O_BINARY);
 		else
-			setmode(fileno(stdin), O_BINARY);
+			_setmode(fileno(stdin), O_BINARY);
 	}
 #endif
 
-- 
2.7.4.windows.1

