This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] elf: Add tst-ldconfig-bad-aux-cache test [BZ #18093]
- From: Florian Weimer <fweimer at redhat dot com>
- To: Alexandra Hájková <alexandra dot khirnova at gmail dot com>
- Cc: libc-alpha at sourceware dot org, mcermak at redhat dot com, Alexandra Hájková <ahajkova at redhat dot com>
- Date: Thu, 09 May 2019 14:32:47 +0200
- Subject: Re: [PATCH v2] elf: Add tst-ldconfig-bad-aux-cache test [BZ #18093]
- References: <20190509120019.21415-1-ahajkova@redhat.com>
* Alexandra Hájková:
> + pid = fork ();
I think this should use xfork for error checking.
> + /* Run ldconfig fist to generate the aux-cache. */
> + if (!pid)
> + {
> + execv (args[0], args);
> + }
This should call _exit after execve, in case of failure.
!pid should be written pid == 0, per our style rules, because it is not
a boolean variable.
However, we have recently added support_subprogram, in
<support/subprocess.h>. Maybe you could use that instead? It should
take care of all the details, including calling xwaitpid.
Thanks,
Florian