svn commit: r237634 - stable/8/lib/libc/gen

Eitan Adler eadler at FreeBSD.org
Wed Jun 27 06:41:15 UTC 2012


Author: eadler
Date: Wed Jun 27 06:41:14 2012
New Revision: 237634
URL: http://svn.freebsd.org/changeset/base/237634

Log:
  MFC r237286, r237523:
  	Don't close an uninitialized descriptor.
  
  PR:		bin/167302
  Approved by:	cperciva (implicit)

Modified:
  stable/8/lib/libc/gen/syslog.c
Directory Properties:
  stable/8/lib/libc/   (props changed)

Modified: stable/8/lib/libc/gen/syslog.c
==============================================================================
--- stable/8/lib/libc/gen/syslog.c	Wed Jun 27 06:41:10 2012	(r237633)
+++ stable/8/lib/libc/gen/syslog.c	Wed Jun 27 06:41:14 2012	(r237634)
@@ -413,8 +413,10 @@ void
 closelog(void)
 {
 	THREAD_LOCK();
-	(void)_close(LogFile);
-	LogFile = -1;
+	if (LogFile != -1) {
+		(void)_close(LogFile);
+		LogFile = -1;
+	}
 	LogTag = NULL;
 	status = NOCONN;
 	THREAD_UNLOCK();


More information about the svn-src-stable mailing list