summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Deolasee2014-12-15 09:14:27 +0000
committerPavan Deolasee2015-04-15 05:46:41 +0000
commit50fbbefbd08adc7419f803c004d33236db80c595 (patch)
treeba1f4d22902173bae5fadf8e29d74ae09404d682
parente7e6f4d4e1801aa8a34a06f7d62dba809222b4df (diff)
Allow compilation on FreeBSD and also check for existance of bash
Report and patch from Jov.
-rwxr-xr-xcontrib/pgxc_ctl/make_signature2
-rw-r--r--contrib/pgxc_ctl/pgxc_ctl.c11
-rw-r--r--contrib/pgxc_ctl/utils.h1
-rw-r--r--src/gtm/gtm_ctl/gtm_ctl.c1
4 files changed, 14 insertions, 1 deletions
diff --git a/contrib/pgxc_ctl/make_signature b/contrib/pgxc_ctl/make_signature
index 04020f3a0c..bdc3d42ebf 100755
--- a/contrib/pgxc_ctl/make_signature
+++ b/contrib/pgxc_ctl/make_signature
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#--------------------------------------------------------------------
#
# make_signature
diff --git a/contrib/pgxc_ctl/pgxc_ctl.c b/contrib/pgxc_ctl/pgxc_ctl.c
index 4f47c656b0..d09a2bbd83 100644
--- a/contrib/pgxc_ctl/pgxc_ctl.c
+++ b/contrib/pgxc_ctl/pgxc_ctl.c
@@ -440,6 +440,17 @@ int main(int argc, char *argv[])
{0, 0, 0, 0}
};
+#ifdef XCP
+ int is_bash_exist = system("command -v bash");
+
+ if ( is_bash_exist != 0 )
+ {
+ fprintf(stderr, "Cannot find bash. Please ensure that bash is "
+ "installed and available in the PATH\n");
+ exit(2);
+ }
+#endif
+
strcpy(progname, argv[0]);
init_var_hash();
diff --git a/contrib/pgxc_ctl/utils.h b/contrib/pgxc_ctl/utils.h
index 976f001c56..d2a7eb4500 100644
--- a/contrib/pgxc_ctl/utils.h
+++ b/contrib/pgxc_ctl/utils.h
@@ -10,6 +10,7 @@
*/
#include <stdlib.h>
#include <stdio.h>
+#include <sys/types.h>
extern void *Malloc(size_t size);
extern void *Malloc0(size_t size);
diff --git a/src/gtm/gtm_ctl/gtm_ctl.c b/src/gtm/gtm_ctl/gtm_ctl.c
index 29c78c8d00..af9b4aa25c 100644
--- a/src/gtm/gtm_ctl/gtm_ctl.c
+++ b/src/gtm/gtm_ctl/gtm_ctl.c
@@ -17,6 +17,7 @@
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/wait.h>
#include <unistd.h>
#ifdef HAVE_SYS_RESOURCE_H