From owner-svn-src-stable@FreeBSD.ORG Mon Jul 2 07:37:06 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 96385106564A; Mon, 2 Jul 2012 07:37:06 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82F328FC08; Mon, 2 Jul 2012 07:37:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q627b6ge055368; Mon, 2 Jul 2012 07:37:06 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q627b6pf055366; Mon, 2 Jul 2012 07:37:06 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201207020737.q627b6pf055366@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 2 Jul 2012 07:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237973 - stable/9/lib/libc/gen X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2012 07:37:06 -0000 Author: obrien Date: Mon Jul 2 07:37:06 2012 New Revision: 237973 URL: http://svn.freebsd.org/changeset/base/237973 Log: MFC: r228193: tweak the r137233 fix to r136283 -- Code was making two send() attempts vs. the comment documented "If we are working with a privileged socket, then take only one attempt". Make the code match. Modified: stable/9/lib/libc/gen/syslog.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/syslog.c ============================================================================== --- stable/9/lib/libc/gen/syslog.c Mon Jul 2 07:27:14 2012 (r237972) +++ stable/9/lib/libc/gen/syslog.c Mon Jul 2 07:37:06 2012 (r237973) @@ -265,7 +265,7 @@ vsyslog(int pri, const char *fmt, va_lis * 1) syslogd was restarted * 2) /var/run/log is out of socket buffer space, which * in most cases means local DoS. - * We attempt to reconnect to /var/run/log to take care of + * We attempt to reconnect to /var/run/log[priv] to take care of * case #1 and keep send()ing data to cover case #2 * to give syslogd a chance to empty its socket buffer. * @@ -281,13 +281,13 @@ vsyslog(int pri, const char *fmt, va_lis connectlog(); } do { + if (status == CONNPRIV) + break; _usleep(1); if (send(LogFile, tbuf, cnt, 0) >= 0) { THREAD_UNLOCK(); return; } - if (status == CONNPRIV) - break; } while (errno == ENOBUFS); } else { THREAD_UNLOCK();