From 00be0effe7e8dbd648cb59fdd59b6b44f47cb32c Mon Sep 17 00:00:00 2001 From: SJ Date: Fri, 6 Jul 2012 21:44:57 +0200 Subject: [PATCH] added build info --- src/config.h | 2 +- src/misc.c | 7 ++++--- src/misc.h | 1 + src/piler.c | 6 +++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/config.h b/src/config.h index c8e082d3..c0d432c1 100644 --- a/src/config.h +++ b/src/config.h @@ -13,7 +13,7 @@ #define VERSION "0.1.19" -#define PROGINFO VERSION ", Janos SUTO \n\n" CONFIGURE_PARAMS "\n" +#define BUILD 671 #define HOSTID "mailarchiver" diff --git a/src/misc.c b/src/misc.c index 8cc0bbd1..99155c0f 100644 --- a/src/misc.c +++ b/src/misc.c @@ -25,9 +25,10 @@ #include "tai.h" -/* - * fatal function for quitting - */ +int get_build(){ + return BUILD; +} + void __fatal(char *s){ fprintf(stderr, "%s\n", s); diff --git a/src/misc.h b/src/misc.h index 941b7c6e..c0bdbfcb 100644 --- a/src/misc.h +++ b/src/misc.h @@ -10,6 +10,7 @@ #include #include "defs.h" +int get_build(); void __fatal(char *s); long tvdiff(struct timeval a, struct timeval b); int searchStringInBuffer(char *s, int len1, char *what, int len2); diff --git a/src/piler.c b/src/piler.c index cf973e14..666ba1fa 100644 --- a/src/piler.c +++ b/src/piler.c @@ -328,8 +328,8 @@ int main(int argc, char **argv){ case 'v' : case 'V' : - __fatal(PROGNAME " " PROGINFO); - break; + printf("%s %s, build %d, Janos SUTO \n\n%s\n\n", PROGNAME, VERSION, get_build(), CONFIGURE_PARAMS); + return 0; case 'h' : default : @@ -373,7 +373,7 @@ int main(int argc, char **argv){ if(drop_privileges(pwd)) fatal(ERR_SETUID); - syslog(LOG_PRIORITY, "%s %s starting", PROGNAME, VERSION); + syslog(LOG_PRIORITY, "%s %s, build %d starting", PROGNAME, VERSION, get_build()); #if HAVE_DAEMON == 1