aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-03-07 01:34:42 +0000
committerJonathan McCrohan <jmccrohan@gmail.com>2012-03-07 01:34:42 +0000
commit3a3f779487fc45ad7890c4fba7e3735a721e51f4 (patch)
tree3ce978d2d5fce95c94572f373e6e09b440f7e12a /src
parentf2c218206e155bd0552cac490fa752eb523874d8 (diff)
downloadverteco-3a3f779487fc45ad7890c4fba7e3735a721e51f4.tar.gz
Add compile time version numbers
Uses git tags as version number
Diffstat (limited to 'src')
-rw-r--r--src/modbuslog.c7
1 files changed, 6 insertions, 1 deletions
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 <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@@ -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;