pg_upgrade copy_file not needed on Win32 - Mailing list pgsql-hackers

From Bruce Momjian
Subject pg_upgrade copy_file not needed on Win32
Date
Msg-id 201104240030.p3O0UNr22292@momjian.us
Whole thread Raw
List pgsql-hackers
I have applied the attached patch which prevents copy_file() from being
compiled on Win32, per report from Andrew Dunstan.  copy_file() is not
used on Win32 and generates a warning.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/contrib/pg_upgrade/file.c b/contrib/pg_upgrade/file.c
new file mode 100644
index f8f7233..0552541
*** a/contrib/pg_upgrade/file.c
--- b/contrib/pg_upgrade/file.c
***************
*** 12,20 ****
  #include <fcntl.h>


- static int    copy_file(const char *fromfile, const char *tofile, bool force);

! #ifdef WIN32
  static int    win32_pghardlink(const char *src, const char *dst);
  #endif

--- 12,21 ----
  #include <fcntl.h>



! #ifndef WIN32
! static int    copy_file(const char *fromfile, const char *tofile, bool force);
! #else
  static int    win32_pghardlink(const char *src, const char *dst);
  #endif

*************** linkAndUpdateFile(pageCnvCtx *pageConver
*** 126,131 ****
--- 127,133 ----
  }


+ #ifndef WIN32
  static int
  copy_file(const char *srcfile, const char *dstfile, bool force)
  {
*************** copy_file(const char *srcfile, const cha
*** 220,225 ****
--- 222,228 ----

      return 1;
  }
+ #endif


  /*

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: pgwin32_send
Next
From: Jaime Casanova
Date:
Subject: Re: time-delayed standbys