Code Review
/
src
/
app-framework-main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Set application id when forking
[src/app-framework-main.git]
/
src
/
verbose.c
diff --git
a/src/verbose.c
b/src/verbose.c
index
2045bde
..
6d0db01
100644
(file)
--- a/
src/verbose.c
+++ b/
src/verbose.c
@@
-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)
{
void verbose_set_name(const char *name, int authority)
{
+ closelog();
openlog(name, LOG_PERROR, authority ? LOG_AUTH : LOG_USER);
}
#else
openlog(name, LOG_PERROR, authority ? LOG_AUTH : LOG_USER);
}
#else
+#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <unistd.h>
-static c
onst c
har *appname;
+static char *appname;
static int appauthority;
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)
{
void verbose_set_name(const char *name, int authority)
{
- appname = name;
+ free(appname);
+ appname = name ? strdup(name) : NULL;
appauthority = authority;
}
appauthority = authority;
}