From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 25 07:57:17 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E49DBE2; Tue, 25 Feb 2014 07:57:17 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF5471844; Tue, 25 Feb 2014 07:57:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P7vH8j083639; Tue, 25 Feb 2014 07:57:17 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P7vHh7083638; Tue, 25 Feb 2014 07:57:17 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402250757.s1P7vHh7083638@svn.freebsd.org> From: Christian Brueffer Date: Tue, 25 Feb 2014 07:57:17 +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: r262475 - stable/9/usr.sbin/powerd 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.17 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: Tue, 25 Feb 2014 07:57:18 -0000 Author: brueffer Date: Tue Feb 25 07:57:17 2014 New Revision: 262475 URL: http://svnweb.freebsd.org/changeset/base/262475 Log: MFC: r261773 In acline_init(), initialize ac_line to SRC_UNKNOWN. Previously this could lead to the -n option effectively being ignored (in case ac_line happened to be 0 aka SRC_AC), or other undefined behaviour. PR: 169779 Submitted by: Alex Gonzalez Reviewed by: jhb Modified: stable/9/usr.sbin/powerd/powerd.c Directory Properties: stable/9/usr.sbin/powerd/ (props changed) Modified: stable/9/usr.sbin/powerd/powerd.c ============================================================================== --- stable/9/usr.sbin/powerd/powerd.c Tue Feb 25 07:55:03 2014 (r262474) +++ stable/9/usr.sbin/powerd/powerd.c Tue Feb 25 07:57:17 2014 (r262475) @@ -278,6 +278,7 @@ static void acline_init(void) { acline_mib_len = 4; + acline_status = SRC_UNKNOWN; if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) { acline_mode = ac_sysctl;