From owner-freebsd-bugs Fri Jul 16 2:40: 4 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id AB7E114D23 for ; Fri, 16 Jul 1999 02:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id CAA21978; Fri, 16 Jul 1999 02:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from holonet.net (giskard.holonet.net [198.207.169.7]) by hub.freebsd.org (Postfix) with ESMTP id 9EAC814C9F for ; Fri, 16 Jul 1999 02:33:29 -0700 (PDT) (envelope-from adamw@holonet.net) Received: from (adamw@localhost) by holonet.net (Adam Wight) id CAA01048; Fri, 16 Jul 1999 02:31:50 -0700 Message-Id: <199907160931.CAA01048@holonet.net> Date: Fri, 16 Jul 99 2:31:49 PDT From: Adam Wight Reply-To: adamw@holonet.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/12663: Ambiguous if statement. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 12663 >Category: kern >Synopsis: Ambiguous if statement >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jul 16 02:40:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Adam Wight >Release: FreeBSD 4.0-CURRENT i386 >Organization: >Environment: all >Description: The file sys/i386/apm/apm.c contains an ambiguous if...else statement that appears to be parsed correctly by the compiler, but could break silently depending on the compiler release. >How-To-Repeat: >Fix: Sorry, you might have to use patch -l... =================================================================== RCS file: /usr/cvs/src/sys/i386/apm/apm.c,v retrieving revision 1.90 diff -c -r1.90 apm.c *** apm.c 1999/07/10 18:08:48 1.90 --- apm.c 1999/07/13 17:45:38 *************** *** 1283,1293 **** struct apm_softc *sc = &apm_softc; int revents = 0; ! if (events & (POLLIN | POLLRDNORM)) ! if (sc->event_count) revents |= events & (POLLIN | POLLRDNORM); ! else selrecord(p, &sc->sc_rsel); return (revents); } --- 1283,1295 ---- struct apm_softc *sc = &apm_softc; int revents = 0; ! if (events & (POLLIN | POLLRDNORM)) { ! if (sc->event_count) { revents |= events & (POLLIN | POLLRDNORM); ! } else { selrecord(p, &sc->sc_rsel); + } + } return (revents); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message