Index: src/logging.c =================================================================== RCS file: /data/cvs/libxen/src/logging.c,v retrieving revision 1.6 diff -u -r1.6 logging.c --- src/logging.c 15 Jan 2009 19:56:05 -0000 1.6 +++ src/logging.c 20 Jan 2009 21:15:20 -0000 @@ -626,15 +626,27 @@ return(len); } +static char *current_ident = NULL; + static void virLogCloseSyslog(void *data ATTRIBUTE_UNUSED) { closelog(); + VIR_FREE(current_ident); } static int virLogAddOutputToSyslog(int priority, const char *ident) { - openlog(ident, 0, 0); + /* + * ident need to be kept around on Solaris + */ + VIR_FREE(current_ident); + current_ident = strdup(ident); + if (current_ident == NULL) + return(-1); + + openlog(current_ident, 0, 0); if (virLogDefineOutput(virLogOutputToSyslog, virLogCloseSyslog, NULL, priority, 0) < 0) { closelog(); + VIR_FREE(current_ident); return(-1); } return(0);