diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 5baea4cf77bf62318b0d4ccb9971f40545907aa0..b90d6a1a3867acfcb8e75a818931c138e4bd3338 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -483,9 +483,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
 
 		if (file == NULL)
 		{
-#ifndef WIN32
 			mode_t		filemode;
-#endif
 
 			/*
 			 * No current file, so this must be the header for a new file