bdr: Windows? Not yet. #ifdef out bdr_exec_init_replica
authorCraig Ringer <craig@2ndquadrant.com>
Tue, 29 Apr 2014 13:15:03 +0000 (21:15 +0800)
committerAndres Freund <andres@anarazel.de>
Thu, 3 Jul 2014 15:55:29 +0000 (17:55 +0200)
In future we should CreateProcessEx for Windows. This really wants a new
function for port/ that uses fork()/exec() on *nix, and CreateProcessEx on
Windows.

That's not within the scope of BDR as specified, and time's a-'ticking, so for
now let's just make this feature unsupported on Windows so the buildfarm stops
whining.

contrib/bdr/bdr_init_replica.c

index ff679b9d2ed782bf4b4d4b7f30959fcacc562719..067cbb66b862e549e322404acbc44937774bf8d3 100644 (file)
@@ -521,6 +521,7 @@ bdr_init_replica_cleanup_tmpdir(int errcode, Datum tmpdir)
 static void
 bdr_exec_init_replica(Name conn_name, char *snapshot)
 {
+#ifndef WIN32
    pid_t pid;
    char *bindir;
    char *tmpdir;
@@ -664,6 +665,18 @@ bdr_exec_init_replica(Name conn_name, char *snapshot)
    pfree(replica_local_dsn);
    pfree(remote_dsn);
    pfree(tmpdir);
+#else
+   /*
+    * On Windows we should be using CreateProcessEx instead of fork() and
+    * exec().  We should add an abstraction for this to port/ eventually,
+    * so this code doesn't have to care about the platform.
+    *
+    * TODO
+    */
+   ereport(ERROR,
+           (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+            errmsg("init_replica isn't supported on Windows yet")));
+#endif
 }
 
 /*