summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/syslog.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
index 6bba3930e91..87f838decb0 100644
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslog.c,v 1.28 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: syslog.c,v 1.29 2007/11/09 18:40:19 millert Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
@@ -279,8 +279,12 @@ vsyslog_r(int pri, struct syslog_data *data, const char *fmt, va_list ap)
(void)close(fd);
}
- if (data != &sdata)
+ if (data != &sdata) {
+ /* preserve log_tag from being cleared by closelog_r() */
+ const char *ident = data->log_tag;
closelog_r(data);
+ data->log_tag = ident;
+ }
}
static void