On Thu, Nov 13, 2025 at 03:58:50PM -0600, Eric Blake via Libguestfs wrote:
No need to re-strdup things in a loop of getline - since we are
using
popen to get the output in the first place, we can use the shell to
hand us just the final line.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Even though the POSIX folks ruled today that our "ab"use of a
getline() loop to determine the final line of du output was
non-portable [1], I was still miffed at the malloc overhead that our
workaround for rawhide glibc entailed. So this is the result I came
up with.
[1]
https://www.austingroupbugs.net/bug_view_page.php?bug_id=1953
I hit send too soon; I meant to add that this is in response to commit
01b8e557ce from Oct 27.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:
qemu.org |
libguestfs.org