Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 7271 invoked by uid 6000); 13 Sep 1999 11:23:11 -0000 Received: (qmail 7261 invoked by uid 2016); 13 Sep 1999 11:23:08 -0000 Delivered-To: apcore-apache-2.0-cvs@apache.org Received: (qmail 7256 invoked from network); 13 Sep 1999 11:23:07 -0000 Received: from fwns2d.raleigh.ibm.com (HELO fwns2.raleigh.ibm.com) (204.146.167.236) by taz.hyperreal.org with SMTP; 13 Sep 1999 11:23:07 -0000 Received: from rtpmail03.raleigh.ibm.com (rtpmail03.raleigh.ibm.com [9.37.172.47]) by fwns2.raleigh.ibm.com (8.9.0/8.9.0/RTP-FW-1.2) with ESMTP id HAA21504; Mon, 13 Sep 1999 07:23:02 -0400 Received: from chosondo.raleigh.ibm.com (chosondo.raleigh.ibm.com [9.37.73.195]) by rtpmail03.raleigh.ibm.com (8.8.5/8.8.5/RTP-ral-1.1) with ESMTP id HAA29384; Mon, 13 Sep 1999 07:23:02 -0400 Date: Mon, 13 Sep 1999 07:10:23 -0400 (EDT) From: Ryan Bloom To: new-httpd@apache.org cc: apache-2.0-cvs@apache.org Subject: Re: cvs commit: apache-2.0/src/lib/apr/file_io/unix open.c In-Reply-To: <19990911204258.29319.qmail@hyperreal.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org > > - if ((*new)->filedes < 0 && (*new)->filehand == NULL) { > + if ((*new)->filedes < 0 || (*new)->filehand == NULL) { > (*new)->filedes = -1; > (*new)->eof_hit = 1; > return errno; This is wrong. This says that we NEVER open the file correctly. This is because we only ever set one of the two options, either the filedes or the filehand, NEVER both. We are checking for the error condition, not the successful case. Either the filedes or the filehand WILL be not set after each open. I have serious doubts that the code even works anymore. If it does, it is only because we aren't checking return code properly. Ryan _______________________________________________________________________ Ryan Bloom rbb@raleigh.ibm.com 4205 S Miami Blvd RTP, NC 27709 It's a beautiful sight to see good dancers doing simple steps. It's a painful sight to see beginners doing complicated patterns.