public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "Frank Ch. Eigler" <fche@redhat.com>
To: Aaron Merey <amerey@redhat.com>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH 2/2] debuginfod: ensure X-DEBUGINFOD-SIZE contains file size
Date: Fri, 22 Apr 2022 19:27:31 -0400	[thread overview]
Message-ID: <20220422232731.GF23969@redhat.com> (raw)
In-Reply-To: <20220422222641.316502-1-amerey@redhat.com>

Hi -

> -          add_mhd_response_header (r, "X-DEBUGINFOD-SIZE",
> -                                   to_string(fs.st_size).c_str());

> +          rc = fstat (fd, &fs);
> +          if (rc == 0)
> +            add_mhd_response_header (r, "X-DEBUGINFOD-SIZE",
> +                                     to_string(fs.st_size).c_str());
> +          else
> +            {
> +              close (fd);
> +              throw libc_exception (errno, string("stat ") + b_source1 + " archive " + b_source0);
> +            }


It shouldn't require a new fstat -- the archive component file's size
should be available from libarchive already: archive_entry_size(e);

- FChE


  parent reply	other threads:[~2022-04-22 23:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 22:26 Aaron Merey
2022-04-22 22:31 ` Aaron Merey
2022-04-22 23:27 ` Frank Ch. Eigler [this message]
2022-04-25 15:14   ` [PATCH] " Aaron Merey

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=20220422232731.GF23969@redhat.com \
    --to=fche@redhat.com \
    --cc=amerey@redhat.com \
    --cc=elfutils-devel@sourceware.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).