Fix compilation warning of pg_basebackup with MinGW
authorMichael Paquier <michael@paquier.xyz>
Sun, 21 Jul 2019 13:27:11 +0000 (22:27 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sun, 21 Jul 2019 13:27:11 +0000 (22:27 +0900)
Several buildfarm members have been complaining about that with gcc,
like jacana.  Weirdly enough, Visual Studio's compilers do not find this
issue.

Author: Michael Paquier
Reviewed-by: Andrew Dunstan
Discussion: https://postgr.es/m/20190719050830.GK1859@paquier.xyz

src/bin/pg_basebackup/pg_basebackup.c

index 15f43f9432be3c72399932205830bb2a0118e156..77a7c148baed1e3ebdbdd74b0d6e3bb4cc9abe8a 100644 (file)
@@ -1445,7 +1445,9 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
 
                if (file == NULL)
                {
+#ifndef WIN32
                        int                     filemode;
+#endif
 
                        /*
                         * No current file, so this must be the header for a new file
@@ -1459,8 +1461,10 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
 
                        current_len_left = read_tar_number(&copybuf[124], 12);
 
+#ifndef WIN32
                        /* Set permissions on the file */
                        filemode = read_tar_number(&copybuf[100], 8);
+#endif
 
                        /*
                         * All files are padded up to 512 bytes