1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

tool/ctdb: Always support ctdb version command, don't make it optional

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit f8af7d8de76e68e5c4bde15f832a31ce9107e8c7)
This commit is contained in:
Amitay Isaacs 2012-10-30 11:49:28 +11:00
parent 1a6ccd1bf1
commit b0f90052cb
2 changed files with 4 additions and 9 deletions

View File

@ -71,7 +71,7 @@ export CC
## always run autogen.sh
./autogen.sh
CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE -DCTDB_VERS=\"%{version}-%{release}\"" ./configure \
CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE" ./configure \
%if %with_included_talloc
--with-included-talloc \
%endif

View File

@ -25,6 +25,7 @@
#include "system/locale.h"
#include "popt.h"
#include "cmdline.h"
#include "../include/version.h"
#include "../include/ctdb.h"
#include "../include/ctdb_client.h"
#include "../include/ctdb_private.h"
@ -56,15 +57,11 @@ static struct {
#define TIMELIMIT() timeval_current_ofs(options.timelimit, 0)
#define LONGTIMELIMIT() timeval_current_ofs(options.timelimit*10, 0)
#ifdef CTDB_VERS
static int control_version(struct ctdb_context *ctdb, int argc, const char **argv)
{
#define STR(x) #x
#define XSTR(x) STR(x)
printf("CTDB version: %s\n", XSTR(CTDB_VERS));
printf("CTDB version: %s\n", CTDB_VERSION_STRING);
return 0;
}
#endif
#define CTDB_NOMEM_ABORT(p) do { if (!(p)) { \
DEBUG(DEBUG_ALERT,("ctdb fatal error: %s\n", \
@ -5786,9 +5783,7 @@ static const struct {
const char *msg;
const char *args;
} ctdb_commands[] = {
#ifdef CTDB_VERS
{ "version", control_version, true, false, "show version of ctdb" },
#endif
{ "version", control_version, true, true, "show version of ctdb" },
{ "status", control_status, true, false, "show node status" },
{ "uptime", control_uptime, true, false, "show node uptime" },
{ "ping", control_ping, true, false, "ping all nodes" },