about summary refs log tree commit diff
path: root/misc/syslog.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/syslog.c')
-rw-r--r--misc/syslog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/misc/syslog.c b/misc/syslog.c
index 18330a373b..e228860d22 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -284,7 +284,8 @@ __vsyslog_internal(int pri, const char *fmt, va_list ap,
 		 * syslogd failure.
 		 */
 		if (LogStat & LOG_CONS &&
-		    (fd = __open(_PATH_CONSOLE, O_WRONLY|O_NOCTTY, 0)) >= 0)
+		    (fd = __open(_PATH_CONSOLE, O_WRONLY|O_NOCTTY|O_CLOEXEC,
+				 0)) >= 0)
 		  {
 		    __dprintf (fd, "%s\r\n", buf + msgoff);
 		    (void)__close(fd);