Re: [LTP] [PATCH v3 1/4] lib: Add tst_fd iterator

Petr Vorel
2024-01-15T23:10:19Z

Hi,

...
> --- /dev/null
> +++ b/lib/tst_fd.c
> @@ -0,0 +1,325 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
...
> +static void open_eventfd(struct tst_fd *fd)
> +{
> + fd->fd = eventfd(0, 0);
> +
> + if (fd->fd < 0) {
> + tst_res(TCONF | TERRNO,
very nit: this could be on single line, without brackets.
> + "Skipping %s", tst_fd_desc(fd));
> + }
> +}
> +
> +static void open_signalfd(struct tst_fd *fd)
> +{
> + sigset_t sfd_mask;
nit: space here saves checkpatch warning.
> + sigemptyset(&sfd_mask);
> +
> + fd->fd = signalfd(-1, &sfd_mask, 0);
> + if (fd->fd < 0) {
> + tst_res(TCONF | TERRNO,
> + "Skipping %s", tst_fd_desc(fd));
> + }
> +}
> +
> +static void open_timerfd(struct tst_fd *fd)
> +{
> + fd->fd = timerfd_create(CLOCK_REALTIME, 0);
> + if (fd->fd < 0) {
> + tst_res(TCONF | TERRNO,
Here as well.
> + "Skipping %s", tst_fd_desc(fd));
> + }
> +}
...

Obviously ready to merge, thanks!
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr