From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20962 invoked by alias); 18 Apr 2002 15:17:43 -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 20847 invoked from network); 18 Apr 2002 15:17:32 -0000 Received: from unknown (HELO is.elta.co.il) (199.203.121.2) by sources.redhat.com with SMTP; 18 Apr 2002 15:17:32 -0000 Received: from is (is [199.203.121.2]) by is.elta.co.il (8.9.3/8.8.8) with SMTP id TAA08939; Thu, 18 Apr 2002 19:16:10 +0300 (IDT) Date: Thu, 18 Apr 2002 08:17:00 -0000 From: Eli Zaretskii X-Sender: eliz@is To: Joel Brobecker cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Should openp open directories? In-Reply-To: <20020418122535.B11802@act-europe.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-04/txt/msg00591.txt.bz2 On Thu, 18 Apr 2002, Joel Brobecker wrote: > 2002-04-18 Joel Brobecker > > * source.c (is_regular_file): New function. > (openp): Check wether file to open is a regular file > to avoid opening directories. 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. 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?