fix: do not exit in is_standby()

Instead we now return an int with 0 meaning „not a standby,“ 1 meaning
„is a standby“ and -1 meaning „connection dropped“
This commit is contained in:
Christian Kruse
2014-01-10 17:11:16 +01:00
parent c41030b40e
commit 4fabfbbbd0
4 changed files with 62 additions and 33 deletions

View File

@@ -26,7 +26,7 @@ PGconn *establishDBConnection(const char *conninfo, const bool exit_on_error);
PGconn *establishDBConnectionByParams(const char *keywords[],
const char *values[],
const bool exit_on_error);
bool is_standby(PGconn *conn);
int is_standby(PGconn *conn);
bool is_witness(PGconn *conn, char *schema, char *cluster, int node_id);
bool is_pgup(PGconn *conn, int timeout);
char *pg_version(PGconn *conn, char* major_version);