From 3a3f779487fc45ad7890c4fba7e3735a721e51f4 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Wed, 7 Mar 2012 01:34:42 +0000 Subject: Add compile time version numbers Uses git tags as version number --- src/modbuslog.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modbuslog.c b/src/modbuslog.c index ec0e10e..7813aa3 100644 --- a/src/modbuslog.c +++ b/src/modbuslog.c @@ -19,6 +19,10 @@ // gcc modbuslog.c -o modbuslog `pkg-config --libs --cflags libmodbus libconfig` +#ifndef VERSION_STRING +#define VERSION_STRING "[undefined version]" +#endif + #include #include #include @@ -83,7 +87,8 @@ int main(int argc, char *argv[]) { } openlog("modbuslog", SYSLOG_CONSOLE_OUTPUT | LOG_PID | LOG_CONS, LOG_USER); - syslog(LOG_INFO, "modbuslog starting"); + + syslog(LOG_INFO, "modbuslog %s starting",VERSION_STRING); const char *configfile = "/etc/modbuslog.cfg"; config_t cfg; -- cgit v1.2.3