This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Should openp open directories?
- From: Eli Zaretskii <eliz at is dot elta dot co dot il>
- To: Joel Brobecker <brobecker at ACT-Europe dot FR>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 18 Apr 2002 19:16:09 +0300 (IDT)
- Subject: Re: [RFA] Should openp open directories?
On Thu, 18 Apr 2002, Joel Brobecker wrote:
> 2002-04-18 Joel Brobecker <brobecker@gnat.com>
>
> * 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?