public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Aaron Merey <amerey@redhat.com>
To: Mark Wielaard <mark@klomp.org>
Cc: elfutils-devel@sourceware.org
Subject: Re: [COMMITTED] debuginfod_find_section: Always update rc with most recent error code
Date: Mon, 7 Nov 2022 11:19:07 -0500	[thread overview]
Message-ID: <CAJDtP-S3r0RRYKgwjp5TWnnD0d1f1+5-pNU3PaiY6Cfo_FSoiQ@mail.gmail.com> (raw)
In-Reply-To: <d775a1c396ead943d58ee9d260a4a2c3193e442c.camel@klomp.org>

Hi Mark,

On Mon, Nov 7, 2022 at 9:19 AM Mark Wielaard <mark@klomp.org> wrote:
> >    if (rc == -EEXIST)
> >      {
> > -      /* The section should be found in the executable.  */
> > +      /* Either the debuginfo couldn't be found or the section should
> > +      be in the executable.  */
> >        fd = debuginfod_find_executable (client, build_id,
> >                                      build_id_len, &tmp_path);
> >        if (fd > 0)
>
> I know this is in existing code, so this might have missed in a
> previous review. But shouldn't this be fd >= 0 ?
>
> That is what is checked in the rest of the code. Except for the
> debuginfod_find_section function which uses fd >0 twice.
>
> It is unlikely, but I think fd can be zero if it (stdin) was closed by
> the program for some reason. Then I think zero can be reused as new
> file descriptor?

Thanks for catching this typo, will merge a fix.

Aaron


      reply	other threads:[~2022-11-07 16:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 21:40 Aaron Merey
2022-11-07 14:19 ` Mark Wielaard
2022-11-07 16:19   ` Aaron Merey [this message]

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=CAJDtP-S3r0RRYKgwjp5TWnnD0d1f1+5-pNU3PaiY6Cfo_FSoiQ@mail.gmail.com \
    --to=amerey@redhat.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=mark@klomp.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).