From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 18:56:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4C265F0; Thu, 19 Feb 2015 18:56:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B015D9E; Thu, 19 Feb 2015 18:56:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JIue3Q030717; Thu, 19 Feb 2015 18:56:40 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JIue20030716; Thu, 19 Feb 2015 18:56:40 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201502191856.t1JIue20030716@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 19 Feb 2015 18:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279016 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2015 18:56:40 -0000 Author: ed Date: Thu Feb 19 18:56:39 2015 New Revision: 279016 URL: https://svnweb.freebsd.org/changeset/base/279016 Log: Make syslogd work in case shutdown() is POSIX-ly correct. On POSIX conformant systems, shutdown() should return ENOTCONN when not connected. We attempted to fix this once (kern/84761), but this change got backed out because it 'breaks code' (r150155). I just reapplied the patch and indeed, syslogd fails on startup. Make it easier to re-enable this change in the future by paching up syslogd to do the right thing. MFC after: 3 weeks Sponsored by: Nuxi Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Thu Feb 19 17:47:42 2015 (r279015) +++ head/usr.sbin/syslogd/syslogd.c Thu Feb 19 18:56:39 2015 (r279016) @@ -557,7 +557,8 @@ main(int argc, char *argv[]) if (finet) { if (SecureMode) { for (i = 0; i < *finet; i++) { - if (shutdown(finet[i+1], SHUT_RD) < 0) { + if (shutdown(finet[i+1], SHUT_RD) < 0 && + errno != ENOTCONN) { logerror("shutdown"); if (!Debug) die(0);