X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fverbose.c;h=6d0db01a413b3a3a5ae00c7a2329eddaa9ca1027;hb=512e870e35747c6114e0dd5e0d94060b3b3cf6a5;hp=a91aeb1f02d2f3ca62fd463d1b8b8a6b0a639124;hpb=f58eb17b6fd797e1c969f4fd902f450c237a3079;p=src%2Fapp-framework-main.git diff --git a/src/verbose.c b/src/verbose.c index a91aeb1..6d0db01 100644 --- a/src/verbose.c +++ b/src/verbose.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2016 "IoT.bzh" + Copyright (C) 2016, 2017 "IoT.bzh" author: José Bollo @@ -43,14 +43,17 @@ void vverbose(int level, const char *file, int line, const char *fmt, va_list ar void verbose_set_name(const char *name, int authority) { + closelog(); openlog(name, LOG_PERROR, authority ? LOG_AUTH : LOG_USER); } #else +#include +#include #include -static const char *appname; +static char *appname; static int appauthority; @@ -79,7 +82,8 @@ void vverbose(int level, const char *file, int line, const char *fmt, va_list ar void verbose_set_name(const char *name, int authority) { - appname = name; + free(appname); + appname = name ? strdup(name) : NULL; appauthority = authority; }