[PATCH 2/2] debuginfod: ensure X-DEBUGINFOD-SIZE contains file size
Frank Ch. Eigler
fche@redhat.com
Fri Apr 22 23:27:31 GMT 2022
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
More information about the Elfutils-devel
mailing list