From owner-svn-src-stable-9@FreeBSD.ORG Mon Dec 31 03:34:53 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DEA3BAA; Mon, 31 Dec 2012 03:34:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CDD228FC15; Mon, 31 Dec 2012 03:34:52 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBV3Yq05047688; Mon, 31 Dec 2012 03:34:52 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBV3YqBs047687; Mon, 31 Dec 2012 03:34:52 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201212310334.qBV3YqBs047687@svn.freebsd.org> From: Mark Johnston Date: Mon, 31 Dec 2012 03:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244881 - stable/9/usr.sbin/syslogd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2012 03:34:53 -0000 Author: markj Date: Mon Dec 31 03:34:52 2012 New Revision: 244881 URL: http://svnweb.freebsd.org/changeset/base/244881 Log: MFC 244523: - Make sure that errno isn't modified before calling logerror() in error conditions. - Don't check for AF_INET6 when compiled without INET6 support. Approved by: emaste (co-mentor) Modified: stable/9/usr.sbin/syslogd/syslogd.c Modified: stable/9/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/9/usr.sbin/syslogd/syslogd.c Mon Dec 31 03:34:30 2012 (r244880) +++ stable/9/usr.sbin/syslogd/syslogd.c Mon Dec 31 03:34:52 2012 (r244881) @@ -1873,6 +1873,7 @@ cfline(const char *line, struct filed *f pri = decode(buf, prioritynames); if (pri < 0) { + errno = 0; (void)snprintf(ebuf, sizeof ebuf, "unknown priority name \"%s\"", buf); logerror(ebuf); @@ -1901,6 +1902,7 @@ cfline(const char *line, struct filed *f } else { i = decode(buf, facilitynames); if (i < 0) { + errno = 0; (void)snprintf(ebuf, sizeof ebuf, "unknown facility name \"%s\"", buf); @@ -2687,6 +2689,7 @@ socksetup(int af, char *bindhostname) logerror("socket"); continue; } +#ifdef INET6 if (r->ai_family == AF_INET6) { if (setsockopt(*s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&on, sizeof (on)) < 0) { @@ -2695,6 +2698,7 @@ socksetup(int af, char *bindhostname) continue; } } +#endif if (setsockopt(*s, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof (on)) < 0) { logerror("setsockopt"); @@ -2711,8 +2715,8 @@ socksetup(int af, char *bindhostname) */ if (!NoBind) { if (bind(*s, r->ai_addr, r->ai_addrlen) < 0) { - close(*s); logerror("bind"); + close(*s); continue; }