/*
- Copyright (C) 2016 "IoT.bzh"
+ Copyright (C) 2016, 2017 "IoT.bzh"
author: José Bollo <jose.bollo@iot.bzh>
void verbose_set_name(const char *name, int authority)
{
+ closelog();
openlog(name, LOG_PERROR, authority ? LOG_AUTH : LOG_USER);
}
#else
+#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
-static const char *appname;
+static char *appname;
static int appauthority;
void verbose_set_name(const char *name, int authority)
{
- appname = name;
+ free(appname);
+ appname = name ? strdup(name) : NULL;
appauthority = authority;
}