mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-14 02:37:40 +00:00
Support for -v (version) feature
This can be usefull for easier way to get informations of the corosync version from users. Version and SVN revision (get by svninfo -c) are displayed. git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2381 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
27b55337ce
commit
9931d50b31
@ -14,6 +14,11 @@ AC_CANONICAL_HOST
|
||||
|
||||
AC_LANG([C])
|
||||
|
||||
# Define SVN revision
|
||||
AC_DEFINE([SVN_REVISION],["m4_esyscmd([svnversion >/dev/null 2>&1 && \
|
||||
svnversion -n || \
|
||||
echo -n exported])"], [SVN revision])
|
||||
|
||||
dnl Fix default variables - "prefix" variable if not specified
|
||||
if test "$prefix" = "NONE"; then
|
||||
prefix="/usr"
|
||||
|
@ -70,7 +70,7 @@ SHARED_LIBS_SO_TWO = $(SHARED_LIBS:%.so.$(SONAME)=%.so.$(SOMAJOR))
|
||||
noinst_HEADERS = apidef.h crypto.h mainconfig.h main.h \
|
||||
quorum.h service.h sync.h timer.h tlist.h totemconfig.h \
|
||||
totemmrp.h totemnet.h totemudp.h totemiba.h totemrrp.h \
|
||||
totemsrp.h util.h version.h vsf.h wthread.h schedwrk.h \
|
||||
totemsrp.h util.h vsf.h wthread.h schedwrk.h \
|
||||
evil.h syncv2.h
|
||||
|
||||
EXTRA_DIST = $(LCRSO_SRC)
|
||||
|
14
exec/main.c
14
exec/main.c
@ -83,7 +83,6 @@
|
||||
#include "apidef.h"
|
||||
#include "service.h"
|
||||
#include "schedwrk.h"
|
||||
#include "version.h"
|
||||
#include "evil.h"
|
||||
|
||||
LOGSYS_DECLARE_SYSTEM ("corosync",
|
||||
@ -757,7 +756,7 @@ int main (int argc, char **argv)
|
||||
background = 1;
|
||||
setprio = 1;
|
||||
|
||||
while ((ch = getopt (argc, argv, "fp")) != EOF) {
|
||||
while ((ch = getopt (argc, argv, "fpv")) != EOF) {
|
||||
|
||||
switch (ch) {
|
||||
case 'f':
|
||||
@ -766,12 +765,19 @@ int main (int argc, char **argv)
|
||||
break;
|
||||
case 'p':
|
||||
setprio = 0;
|
||||
break;
|
||||
case 'v':
|
||||
printf ("Corosync Cluster Engine, version '%s' SVN revision '%s'\n", VERSION, SVN_REVISION);
|
||||
printf ("Copyright (c) 2006-2009 Red Hat, Inc.\n");
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, \
|
||||
"usage:\n"\
|
||||
" -f : Start application in foreground.\n"\
|
||||
" -p : Do not set process priority. \n");
|
||||
" -p : Do not set process priority. \n"\
|
||||
" -v : Display version and SVN revision of Corosync and exit.\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
@ -790,7 +796,7 @@ int main (int argc, char **argv)
|
||||
|
||||
corosync_mlockall ();
|
||||
|
||||
log_printf (LOGSYS_LEVEL_NOTICE, "Corosync Cluster Engine ('%s'): started and ready to provide service.\n", RELEASE_VERSION);
|
||||
log_printf (LOGSYS_LEVEL_NOTICE, "Corosync Cluster Engine ('%s'): started and ready to provide service.\n", VERSION);
|
||||
|
||||
(void)signal (SIGINT, sigintr_handler);
|
||||
(void)signal (SIGUSR2, sigusr2_handler);
|
||||
|
@ -1 +0,0 @@
|
||||
#define RELEASE_VERSION "trunk"
|
Loading…
Reference in New Issue
Block a user