This allows the correct output when the log functions are used from separate vpn daemon. --- src/connman.h | 3 ++- src/log.c | 5 +++-- src/main.c | 3 ++- unit/test-nat.c | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/connman.h b/src/connman.h index 7e1f302..d28a355 100644 --- a/src/connman.h +++ b/src/connman.h @@ -112,7 +112,8 @@ int __connman_agent_report_error(struct connman_service *service, #include <connman/log.h> int __connman_log_init(const char *program, const char *debug, - connman_bool_t detach); + connman_bool_t detach, const char *program_name, + const char *program_version); void __connman_log_cleanup(void); void __connman_log_enable(struct connman_debug_desc *start, struct connman_debug_desc *stop); diff --git a/src/log.c b/src/log.c index 7d1896c..958a2a9 100644 --- a/src/log.c +++ b/src/log.c @@ -292,7 +292,8 @@ void __connman_log_enable(struct connman_debug_desc *start, } int __connman_log_init(const char *program, const char *debug, - connman_bool_t detach) + connman_bool_t detach, const char *program_name, + const char *program_version) { static char path[PATH_MAX]; int option = LOG_NDELAY | LOG_PID; @@ -312,7 +313,7 @@ int __connman_log_init(const char *program, const char *debug, openlog(basename(program), option, LOG_DAEMON); - syslog(LOG_INFO, "Connection Manager version %s", VERSION); + syslog(LOG_INFO, "%s version %s", program_name, program_version); return 0; } diff --git a/src/main.c b/src/main.c index 62e5c54..75b8171 100644 --- a/src/main.c +++ b/src/main.c @@ -530,7 +530,8 @@ int main(int argc, char *argv[]) g_dbus_set_disconnect_function(conn, disconnect_callback, NULL, NULL); - __connman_log_init(argv[0], option_debug, option_detach); + __connman_log_init(argv[0], option_debug, option_detach, + "Connection Manager", VERSION); __connman_dbus_init(conn); diff --git a/unit/test-nat.c b/unit/test-nat.c index 578ff3e..014d910 100644 --- a/unit/test-nat.c +++ b/unit/test-nat.c @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) g_test_init(&argc, &argv, NULL); - __connman_log_init(argv[0], "*", FALSE); + __connman_log_init(argv[0], "*", FALSE, "test-nat", VERSION); __connman_iptables_init(); __connman_nat_init(); -- 1.7.9.5 _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman