Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@ACT-Europe.FR>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Should openp open directories?
Date: Fri, 19 Apr 2002 02:18:00 -0000	[thread overview]
Message-ID: <20020419111807.A7903@act-europe.fr> (raw)
In-Reply-To: <Pine.SUN.3.91.1020418191239.8613E-100000@is>; from eliz@is.elta.co.il on Thu, Apr 18, 2002 at 07:16:09PM +0300

> 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


  reply	other threads:[~2002-04-19  9:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-18  3:25 Joel Brobecker
2002-04-18  8:17 ` Eli Zaretskii
2002-04-19  2:18   ` Joel Brobecker [this message]
2002-04-19  2:54     ` Eli Zaretskii
2002-04-22  4:00       ` Joel Brobecker
2002-04-22 11:33         ` Eli Zaretskii
2002-04-23  4:09           ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020419111807.A7903@act-europe.fr \
    --to=brobecker@act-europe.fr \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox