From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24289 invoked by alias); 19 Apr 2002 09:18:15 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24261 invoked from network); 19 Apr 2002 09:18:10 -0000 Received: from unknown (HELO dublin.ACT-Europe.FR) (212.157.227.154) by sources.redhat.com with SMTP; 19 Apr 2002 09:18:10 -0000 Received: from berlin.ACT-Europe.FR (berlin.int.act-europe.fr [10.10.0.169]) by dublin.ACT-Europe.FR (Postfix) with ESMTP id 2EA10229E31; Fri, 19 Apr 2002 11:18:09 +0200 (MET DST) Received: by berlin.ACT-Europe.FR (Postfix, from userid 507) id 0151FA5C; Fri, 19 Apr 2002 11:18:07 +0200 (CEST) Date: Fri, 19 Apr 2002 02:18:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Should openp open directories? Message-ID: <20020419111807.A7903@act-europe.fr> References: <20020418122535.B11802@act-europe.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from eliz@is.elta.co.il on Thu, Apr 18, 2002 at 07:16:09PM +0300 X-SW-Source: 2002-04/txt/msg00622.txt.bz2 > I think this change is a good idea, but I have one comment: if stat > fails, isn't it better to return non-zero? Yes, I know: it shouldn't > happen, but if we return non-zero in that case, we keep > back-compatibility in case there are some obscure filesystems when that > could happen. It seems a sensible idea to return True when stat fails, except when the file does not exist. I suggest the new following implementation (rough code, not compiled): status = stat (filename, &st); /* A comment here explaining why we return true when errno != ENOENT. Or maybe in the function description ??? */ if (status != 0) return (errno != ENOENT); What do you think? > Also, did you try your patch when there's a directory by that name, but > no executable program? If so, what does the patched GDB say and/or do? Yes. I tried "./gdb/gdb bfd" at the root of the gdb source directory and got the following error message: bfd: No such file or directory. The "or directory" part may be confusing... -- Joel