This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]