From owner-svn-src-head@freebsd.org Sat Dec 24 12:50:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00DEEC8EF18; Sat, 24 Dec 2016 12:50:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C40221077; Sat, 24 Dec 2016 12:50:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBOCoHeK019981; Sat, 24 Dec 2016 12:50:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBOCoH8C019980; Sat, 24 Dec 2016 12:50:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612241250.uBOCoH8C019980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 24 Dec 2016 12:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310504 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2016 12:50:19 -0000 Author: ngie Date: Sat Dec 24 12:50:17 2016 New Revision: 310504 URL: https://svnweb.freebsd.org/changeset/base/310504 Log: Unbreak syslogd after r310494 Don't close all file descriptors greater than STDERR_FILENO (2) in waitdaemon(..) -- only close fd (file descriptor for /dev/null used in subsequent calls to dup2) if it's greater than STDERR_FILENO. Reported by: subbsd@gmail.com, danny@cs.huji.ac.il Pointyhat to: hrs X-MFC with: r310494 Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sat Dec 24 11:49:25 2016 (r310503) +++ head/usr.sbin/syslogd/syslogd.c Sat Dec 24 12:50:17 2016 (r310504) @@ -2348,7 +2348,8 @@ waitdaemon(int maxwait) (void)dup2(fd, STDIN_FILENO); (void)dup2(fd, STDOUT_FILENO); (void)dup2(fd, STDERR_FILENO); - closefrom(STDERR_FILENO + 1); + if (fd > STDERR_FILENO) + (void)close(fd); } return (getppid()); }