Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jun 2012 06:41:00 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r237632 - stable/9/lib/libc/gen
Message-ID:  <201206270641.q5R6f0Vb087557@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Wed Jun 27 06:40:59 2012
New Revision: 237632
URL: http://svn.freebsd.org/changeset/base/237632

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

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

Modified: stable/9/lib/libc/gen/syslog.c
==============================================================================
--- stable/9/lib/libc/gen/syslog.c	Wed Jun 27 06:08:02 2012	(r237631)
+++ stable/9/lib/libc/gen/syslog.c	Wed Jun 27 06:40:59 2012	(r237632)
@@ -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();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206270641.q5R6f0Vb087557>