[LTP] [PATCH v2] Add io_read_eof in common.h utilities

Petr Vorel pvorel@suse.cz
Tue Dec 14 17:40:49 CET 2021


Hi,

...
> +static inline void io_read_eof(const char *filename, volatile int *run_child)
> +{
> +	char buff[4096];
> +	int fd;
> +	int r;
> +
> +	while ((fd = open(filename, O_RDONLY, 0666)) < 0)
Just for a record [1] this open should be checked for errno == EINVAL
in case of /tmp/ being tmpfs.

Kind regards,
Petr

[1] https://lore.kernel.org/ltp/YbjIqypOcAYAnLbl@pevik/T/#t
> +		usleep(100);
> +

Kind regards,
Petr


More information about the ltp mailing list