From owner-freebsd-hackers Tue Apr 1 16:54:07 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id QAA19626 for hackers-outgoing; Tue, 1 Apr 1997 16:54:07 -0800 (PST) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id QAA19620 for ; Tue, 1 Apr 1997 16:54:03 -0800 (PST) Received: from parkplace.cet.co.jp (parkplace.cet.co.jp [202.32.64.1]) by who.cdrom.com (8.8.5/8.6.11) with ESMTP id QAA15540 for ; Tue, 1 Apr 1997 16:53:23 -0800 (PST) Received: from localhost (michaelh@localhost) by parkplace.cet.co.jp (8.8.5/CET-v2.1) with SMTP id AAA22952 for ; Wed, 2 Apr 1997 00:50:19 GMT Date: Wed, 2 Apr 1997 09:50:19 +0900 (JST) From: Michael Hancock To: FreeBSD Hackers Subject: Bugs in libc_r (fwd) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Some C precedence errors. ---------- Forwarded message ---------- Date: 01 Apr 1997 21:52:03 +0200 From: "Alex Fenyo (eowyn)" To: freebsd-current@freebsd.org Subject: Bugs in libc_r Hello, The same bug is repeated 4 times in libc_r. The problem is that the operator '&' has a lower precedence than '==' in C, and the author of the code forgot it at 4 places in the source : in /usr/src/lib/libc_r/uthread/uthread_read.c : ------------------------------------------------------------ if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 && (errno == EWOULDBLOCK || errno == EAGAIN)) { ------------------------------------------------------------ should be replaced by : ------------------------------------------------------------ if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 && (errno == EWOULDBLOCK || errno == EAGAIN)) { ------------------------------------------------------------ The same replacement should be done in : uthread_readv.c, uthread_write.c, uthread_writev.c Could someone apply the modifications ? Alexandre Fenyo